Skip to content

dev mode: trigger SW unregister on rebuild so bun-link source edits propagate #151

Description

@unforced

Symptom

Operator (bun-link dev mode) edits notes source, runs `bun run build`, refreshes browser — still sees old code. The PWA SW is serving the cached bundle until manually unregistered (DevTools → Application → Service Workers → Unregister) or hard-reloaded (Cmd-Shift-R).

This silently masks new code from operators iterating on notes, including investigations of bugs they're trying to fix.

Filed from session

Aaron suspected the SW caching was hiding parts of the active 403 / OAuth-reconnect bug landscape.

Possible fixes

  1. dev-mode build script — `bun run dev` or `bun run build:dev` writes a sentinel into dist/ that triggers SW unregister on next load
  2. dist hash in SW URL — `/sw.js?v=` so bun-link rebuild invalidates the SW path
  3. Doc the workaround — README adds "during local dev with bun-link, run `bun run build && open dev-tools and unregister SW`"

(1) is cleanest. (3) is fallback.

Severity

Low for production. High for operator-iteration UX during testing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions