GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(app): prevent stale service worker startup failures by Brendonovich · Pull Request #45344 · anomalyco/opencode

Conversation

@Brendonovich

@Brendonovich Brendonovich commented Aug 26, 2026

Copy link
Copy Markdown
Member

Issue for this PR

Reported while using opencode serve: a stale service worker left the web app blank after an upgrade. No linked issue.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The old worker served cached HTML pointing to chunks no longer available on the server. Missing chunks returned the SPA HTML, which was then cached as JavaScript or CSS.

  • Stop precaching build generations and intercepting HTML navigation. Keep runtime asset caching, reject HTML on cache reads and writes, and retain access to legacy cached chunks for open tabs.
  • Activate worker updates without forcing document reloads or discarding drafts.
  • Emit bundles under /_assets/. Missing files there return non-cacheable 404s; other non-API paths keep the HTML fallback.

HTML now requires the network instead of using a cached app shell. Existing blank tabs can recover on a subsequent navigation after the updated worker activates; working tabs are not forcibly reloaded.

How did you verify your code works?

  • packages/app: bun run test:service-worker builds the production worker and passes Chromium upgrade/cache tests, including draft preservation, old chunks, and poisoned-cache recovery.
  • packages/app: bun typecheck and bun run typecheck:e2e pass.
  • packages/cli: bun test test/web-ui.test.ts passes, covering asset 404s and preserved HTML fallback.
  • packages/cli: bun typecheck passes.
  • The pre-push repository-wide typecheck passes all 32 tasks.

Screenshots / recordings

No layout or styling changes. Browser regressions exercise the generated production service worker against isolated HTTP fixtures.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Brendonovich
fix(app): prevent stale service worker startup failures
cfe13fa
@Brendonovich
Brendonovich requested a review from Hona as a code owner August 26, 2026 17:50
@Brendonovich
Brendonovich merged commit 0772b67 into v2 Aug 26, 2026
9 of 10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Brendonovich
Brendonovich deleted the web-cache-recovery branch August 26, 2026 18:06
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
@Brendonovich
fix(app): prevent stale service worker startup failures (anomalyco#45344
67dbdc6
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Hona Hona Awaiting requested review from Hona Hona is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Brendonovich
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.