Versioned data fetches, data carried across worker releases, plain load failure, comboRows by rowGain, nextBottles memo, generator id guard - #119
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Data (#109)
app.jsfetches the four data files with?v=<versionLabel>(devunstamped) and refuses a response that is not ok. A load failure sets#loadingto "The menu did not load. Check the connection and reload." with no exception text.sw.jsfetches data withcache: 'no-cache', stores and matches it on origin plus path, and inactivatecopies 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_datafails on an unversioned data fetch, data keyed on the query, or a cache delete without the carry. CLAUDE.md describes the rules.Engine (#117)
openSharedLinkcallsselectMenu('shared'); the gate flags are written only inselectMenuandemptyFilter.comboRowsscores each set withrowGain, so a stand-in is counted.subsetOfis removed.nextBottlesis memoised on the shelf code (rankNextdoes the work). Scoring byrowGaintookcomboRowsfrom 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.loadHavedrops ids not in the bar, so boot's save removes them from the store.Generators (#117)
llms.refuse_unsafe_idsstopspages.pyandcards.pyon a drink id that is not a slug and names it.pages.pyremoves the emptydrink/<id>/folder an orphan page leaves.test_checks.pyadds 11 cases (245 to 256).Checked
make verifypasses.app.js: on 57 shelves (empty, gin, every starter shelf, every single bottle) the Next rows are identical tomainand every+NequalsunlockedBy. A store of{"gin":true,"nothing-such":true}is saved back as{"gin":true}.sw.jswith a mock Cache API: data served offline after two releases, requested withno-cache, and activation completes when the copy throws.../xis refused by both generators with nothing written; an orphan page's folder is removed.?v=dev,?s=3opens on Shared menu, a 404 oncocktails.jsonand 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
?v=v1.x.yin the network panel on the live site after a tag.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.