GeezerVison is showing github.com — test(id): real-browser offline pass for the service worker (#14774 slice 2) by dezren39 · Pull Request #14793 · developing-today/code
Conversation
dezren39
commented
Nov 25, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Part of #14774 (slice 2). Slices 3 to 5 remain.
Before: the service worker's offline behaviour was covered only by unit tests of sw-policy.ts with fake caches. Separately, every e2e web server failed to start ("not a world platform directory") because id serve --world picked up an unbuilt examples/roc-world checkout and treated it as an error, so the nightly e2e run had been red on main.
After: pkgs/id/e2e/tests/offline-service-worker.spec.ts drives the real /sw.js in Playwright. It starts its own id serve, visits /files, stops the server, and checks that /files renders from the worker's cache while the never-visited /settings gets the 503 "You are offline" page. It then restarts the server and checks /settings loads from the network. A second test leaves id-shell-* / id-pages-* caches from another build, installs the worker afresh, and checks its activate step deletes them and keeps this build's caches. id serve now uses the conventional examples/roc-world checkout only when it is actually built, and leaves compilation off otherwise; an explicit --roc-platform or ID_ROC_PLATFORM still errors when invalid.
How: Playwright's setOffline does not reach a service worker's own fetches, and Firefox keeps localhost reachable offline, so the spec stops a real server instead. id_worlds::world_compile::is_platform_dir is shared by the compiler check and the new discovery. Verified remotely with id-e2e-nightly.yml (only_checks: test-e2e): both offline tests pass in Firefox.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…ice 2)
Adds a Playwright spec that goes offline through the browser context,
checks a visited page renders from the worker's cache and an unvisited
one gets the 503 offline page, reconnects, and checks that a newly
installed worker deletes id-shell-*/id-pages-* caches from other builds.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Important
Draft PR not reviewed
Draft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration:
reviews:
auto_review:
drafts: true
- 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
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The test-e2e check's web servers failed to start: serve auto-discovered
../examples/roc-world, which in the nix sandbox has no built host.wasm,
and Compiler::new rejected it, so every spec in the nightly failed.
An explicit --roc-platform or ID_ROC_PLATFORM still errors; a
conventional checkout without a built host now only leaves on-the-fly
compilation off, with a warning.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Firefox keeps localhost reachable while offline by default, so the first
remote run fetched the unvisited page from the server (200, not 503).
Set network.disable-localhost-when-offline for this spec's browser.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Playwright's offline emulation does not reach a service worker's own
fetches (the worker still got a 200 for the unvisited page with the
context offline, in Firefox even with localhost cut). Start a disposable
ephemeral id serve on its own port, stop it to cut the network, and
restart it to reconnect.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Remote check results for 55be6db:
test-e2e (run 45538533551): both offline service worker tests pass in Firefox.
test-unit (run 45559243998): passes, including the new conventional_platform_checkout_is_used_only_when_built test.
cargo-fmt-check, biome-check, prettier-check and clippy-lint fail in the same run, but none of their findings are in this PR's files. The fmt diffs and biome findings don't touch serve.rs, world_compile.rs or the new spec. Prettier flags book/*.md. The clippy errors are unwrap/expect lints in id-worlds/src/host.rs, src/currency/gateway_poc.rs, world_template.rs, gesture.rs, program_registry_pkarr.rs, world_store.rs and id-cli/src/commands/walk.rs. This PR only adds a warning-level "unnecessary qualification" on is_platform_dir.
These four checks are broken on main independently of this change, so I'm merging on the passing tests.
Generated by Claude Code
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
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.
|