Skip to content

Check the service worker for a change on every install - #17

Merged
LucaCappelletti94 merged 2 commits into
mainfrom
w2-worker-update
Oct 12, 2026
Merged

LucaCappelletti94 merged 2 commits into
mainfrom
w2-worker-update

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Owner

A browser checks a registered service worker for a new script when it navigates to a page inside the worker's scope, and the Service Worker spec's Register runs no check when the script URL is unchanged. The static worker that dx bundles lives under /assets/ since #11, and the Rust-handler worker from #3 and #15 has the same kind of scope, so an app's own pages never trigger that check. A changed pushups-sw.js or app build then waits for a soft update, which comes after a push once 24 hours have passed. Both Safaris kept the old worker until the page asked for registration.update().

install now waits for the registration and asks it for that update once per page load. A failed check leaves the browser's current worker in place. The README's web section says so.

The web harness gains an updated scenario, which serves the worker from /scoped/ so the page at / is outside its scope and changes the worker's bytes between two page loads. Before the change the second page still talked to the first worker until the 30 second bound ran out, and after it the new worker answers in Chrome and Firefox. Every other scenario still passes in both browsers.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: LucaCappelletti94/coderabbit/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 09a6b8f0-febc-467d-a026-916e70424616

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.17%. Comparing base (8c15151) to head (9c2a422).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #17   +/-   ##
=======================================
  Coverage   92.16%   92.17%           
=======================================
  Files          33       33           
  Lines        2910     2912    +2     
  Branches       39       39           
=======================================
+ Hits         2682     2684    +2     
  Misses        201      201           
  Partials       27       27           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

Copy link
Copy Markdown

@LucaCappelletti94
LucaCappelletti94 merged commit 1f8e11f into main Oct 12, 2026
79 of 81 checks passed
@LucaCappelletti94
LucaCappelletti94 deleted the w2-worker-update branch October 12, 2026 22:19
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