You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Fix: all-numeric persisted cache hash coerced to Number under non-string storage default → spurious cold-load refetch.** The persisted-hash read used a non-string default (`storageService.get(hashStorageKey, null)`), which sends fs-storage down its `JSON.parse` branch — fs-storage only returns the raw stored string verbatim for a _string_ default. An all-numeric, no-leading-zero hash (exactly the `crc32b(uuid())` shape kendo's backend emits, e.g. `'55776784'`) round-tripped back as a Number, so `localHash` never strict-equaled the string server hash, the skip-when-equal guard never matched, and a redundant `retrieveAll()` fired on every affected cold page-load. The read now uses a string default (raw value returned verbatim) and normalizes the empty-string sentinel back to `null` so the `localHash !== null` cold-start guard is preserved. Consumers pick this up on the version bump; kendo is the live-exposed consumer. Closes enforcement queue #130; mirrors wijs PR #122.
"description": "Higher-order factory wrapping @script-development/fs-adapter-store with hash-bumping cache-check that suppresses redundant retrieveAll GETs at source",
it('an all-numeric persisted hash round-trips through REAL fs-storage as a STRING → an equal server hash skips inner fetch (no spurious cold-load)',async()=>{
1216
+
// Exercises the real fs-storage put(raw) → get(string-default → raw)
1217
+
// contract rather than the stub above (which ignores the default and
1218
+
// is therefore blind to this bug). A `crc32b(uuid())` hash like
1219
+
// '55776784' is all-numeric with no leading zero. Under the OLD
1220
+
// `get(hashStorageKey, null)` read, the non-string default drove
1221
+
// fs-storage's JSON.parse branch, coercing '55776784' → Number
1222
+
// 55776784. `localHash` (Number) then never strict-equals the string
1223
+
// server hash, so skip-when-equal never matched → a redundant
1224
+
// retrieveAll() on every cold load. kendo is live-exposed (its
1225
+
// backend emits crc32b(uuid()) hashes). The fix reads with a string
1226
+
// default so the raw string is returned verbatim.
1227
+
localStorage.clear();
1228
+
constnumericHash='55776784';
1229
+
constcacheKey='lanes';
1230
+
// Real fs-storage, persisted via the SAME service the wrapper reads.
0 commit comments