Skip to content

chore(playground): keep loading grammars when Cache Storage refuses - #43

Merged
maxgfr merged 1 commit into
mainfrom
fix/shared-origin-storage
Nov 2, 2026
Merged

maxgfr merged 1 commit into
mainfrom
fix/shared-origin-storage

Conversation

@maxgfr

@maxgfr maxgfr commented Nov 2, 2026

Copy link
Copy Markdown
Owner

maxgfr.github.io is one origin shared by every project site: its storage quota can be full because of another site, and private windows may refuse Cache Storage. A rejected caches.open / match / put in the playground worker failed the grammar load even after a successful fetch. The grammar cache is now best effort and falls back to the network copy.

Rest of the storage audit: theme key codeindex-theme and cache codeindex-grammars-v1 are already app-scoped, writes are guarded, no cookies, no service worker, no shared wipes.

chore rather than fix: only site/ changes, so no npm release is needed.

Tests: pnpm typecheck, playground unit tests pass. Full pnpm test: 5 CLI tests time out locally, identically on main (unrelated).

maxgfr.github.io is one origin shared by every project site, so its storage
quota can be filled by another site, and private windows may refuse Cache
Storage altogether. A rejected caches.open, match or put made the grammar
load fail even though the wasm had been fetched. The cache is now best
effort: any of those failing falls back to the network copy.

No package change: the playground is only deployed with the site.
@maxgfr
maxgfr merged commit 16b306e into main Nov 2, 2026
2 checks passed
@maxgfr
maxgfr deleted the fix/shared-origin-storage branch November 2, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant