Skip to content

Versioned data fetches, data carried across worker releases, plain load failure, comboRows by rowGain, nextBottles memo, generator id guard - #119

Merged
cjimti merged 1 commit into
mainfrom
data-version-and-engine-nits
Sep 13, 2026
Merged

cjimti merged 1 commit into
mainfrom
data-version-and-engine-nits

Conversation

@cjimti

@cjimti cjimti commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Data (#109)

app.js fetches the four data files with ?v=<versionLabel> (dev unstamped) and refuses a response that is not ok. A load failure sets #loading to "The menu did not load. Check the connection and reload." with no exception text.

sw.js fetches data with cache: 'no-cache', stores and matches it on origin plus path, and in activate copies data entries from the stale caches into the new one (carryData, copyData) before deleting them. A failed copy is caught and does not fail activation.

check_assets.check_data fails on an unversioned data fetch, data keyed on the query, or a cache delete without the carry. CLAUDE.md describes the rules.

Engine (#117)

  • openSharedLink calls selectMenu('shared'); the gate flags are written only in selectMenu and emptyFilter.
  • comboRows scores each set with rowGain, so a stand-in is counted. subsetOf is removed.
  • nextBottles is memoised on the shelf code (rankNext does the work). Scoring by rowGain took comboRows from about 2.5 ms to about 9 ms on a near-empty shelf in node, and the Menu rail asks on every repaint. The gains memo comment carries the timings.
  • loadHave drops ids not in the bar, so boot's save removes them from the store.

Generators (#117)

llms.refuse_unsafe_ids stops pages.py and cards.py on a drink id that is not a slug and names it. pages.py removes the empty drink/<id>/ folder an orphan page leaves. test_checks.py adds 11 cases (245 to 256).

Checked

  • make verify passes.
  • Node harness over app.js: on 57 shelves (empty, gin, every starter shelf, every single bottle) the Next rows are identical to main and every +N equals unlockedBy. A store of {"gin":true,"nothing-such":true} is saved back as {"gin":true}.
  • Node simulation of sw.js with a mock Cache API: data served offline after two releases, requested with no-cache, and activation completes when the copy throws.
  • Scratchpad copy of the repo: an id of ../x is refused by both generators with nothing written; an orphan page's folder is removed.
  • Chrome on localhost:8010: data requested as ?v=dev, ?s=3 opens on Shared menu, a 404 on cocktails.json and a rejected fetch both show the sentence, the unknown id is dropped from the store, Next rows render on the Bar tab and the rail for a gin shelf.

Not checked

  • A real service worker (https only), so the carry across a release and offline load are verified only in simulation.
  • A 304 and ?v=v1.x.y in the network panel on the live site after a tag.
  • 390px, light mode and print; no rendering or CSS changed.

A tab still on an older release drops ids only a newer release knows, and its next tick saves the shelf without them.

Closes #109. Closes #117.

…ad failure, comboRows by rowGain, nextBottles memo, generator id guard

Data: app.js fetches the four data files with ?v=<versionLabel> and refuses a response that is not ok. A load failure sets #loading to "The menu did not load. Check the connection and reload." with no exception text.

Worker: sw.js fetches data with cache: 'no-cache', stores and matches it on origin plus path, and in activate copies data entries from the stale caches into the new one (carryData, copyData) before deleting them. A failed copy is caught and does not fail activation. check_assets.check_data fails on an unversioned data fetch, data keyed on the query, or a delete without the carry. CLAUDE.md describes the rules.

Engine: openSharedLink calls selectMenu('shared'). comboRows scores each set with rowGain, so a stand-in is counted; subsetOf is removed. nextBottles is memoised on the shelf code (rankNext does the work), and the gains memo comment carries the measured timings. loadHave drops ids not in the bar, so boot's save removes them from the store.

Generators: llms.refuse_unsafe_ids stops pages.py and cards.py on a drink id that is not a slug and names it. pages.py removes the empty drink/<id>/ folder an orphan page leaves. test_checks.py adds 11 cases (245 to 256).

Closes #109. Closes #117.
@cjimti
cjimti merged commit ca1cd32 into main Sep 13, 2026
1 check passed
@cjimti
cjimti deleted the data-version-and-engine-nits branch September 13, 2026 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant