8000 The service-worker cache name is a constant, but migrations.md claims it is release-keyed · Issue #48 · kiran-brahma/writing-tool · GitHub
[go: up one dir, main page]

Skip to content

The service-worker cache name is a constant, but migrations.md claims it is release-keyed #48

Closed

Description

@kiran-brahma

What

docs/migrations.md states that the service-worker shell cache is release-keyed and bumped on every
deploy, so that activate deletes the previous release's cache wholesale. The code does not do
that.

  • docs/migrations.md — "public/sw.js names its cache for the release (bumped on every deploy), so
    activate deletes the previous release's cache wholesale."
  • public/sw.js:23 — const CACHE_NAME = "obelus-shell-v1";, unchanged across every commit that
    has touched the file (git log -S"obelus-shell" -- public/sw.js shows one commit).
  • public/sw.js:22 — the comment // Keyed to the release: bump this on every deploy. is therefore
    false.
  • pnpm run deploy has no bump step, and no gate checks it.

Impact

activate's keys.filter((key) => key !== CACHE_NAME).map((key) => caches.delete(key)) loop is
inert, so the documented rollback mechanism is not the one doing the work. Rollback correctness then
rests entirely on the navigation-time syncShellAssets prune, which only runs on a successful
online navigation. The behaviour is probably acceptable; the documentation is wrong about which
mechanism is load-bearing, which is the part that matters when someone reasons about a rollback.

Fix

Either make the claim true — derive CACHE_NAME from a build-injected release id and add a gate
that it differs from the deployed one — or correct docs/migrations.md and the sw.js comment to
describe the prune as the actual mechanism.

Do not change the migration policy itself; this is only about the claim.

Origin

Found by the Thermos review (thermo-nuclear, storage/UI + code-review Standards axis).

Activity

  1. kiran-brahma commented on Sep 26, 2026

    @kiran-brahma
    OwnerAuthor

    Decision (Writer, 2026-09-26): correct the docs. Rewrite the docs/migrations.md passage and the public/sw.js comment to name the navigation-time syncShellAssets prune as the mechanism that does the work. CACHE_NAME stays a constant. No behaviour change, no deploy step, no migration-policy change.

  2. added a commit that references this issue on Sep 26, 2026
    7aa2623
  3. kiran-brahma commented on Sep 26, 2026

    @kiran-brahma
    OwnerAuthor

    Fixed in #70 (merged into v1.3), following the 2026-09-26 decision: docs and the sw.js comment now name the navigation-time prune; CACHE_NAME unchanged.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationready-for-agentSpec is ready for an agent to implement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0