Repository navigation
Adopt @statewalker/webrun-http-browser 0.5.0; mountEdge relies on its uncontrolled-page recovery - #6
Merged
Merged
Conversation
A caret on 0.x pins the minor, so ^0.4.x would never pick up 0.5.0. Moves httpeers-member (peer and dev), httpeers-browser-conformance, demos and llm-chat to ^0.5.0; the standalone lockfile changes only those edges. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… page
0.5's SwHttpAdapter.start() asks an active worker to claim an uncontrolled
page (CLAIM, answered by the stock sw-worker every app ships as /sw.js),
bounds every wait by `timeout`, and can reload once, guarded, when the
claim does not take. mountEdge now relies on that instead of its own
pre-check and reload guard: a hard reload recovers in place, with no
navigation.
- edge-control.ts shrinks to edgeStartError: ServiceWorkerControlError,
matched by name/reason, becomes UncontrolledPageError ("close the tab and
reopen it") for `uncontrolled`, and the existing actionable Error for
`activation-timeout` / `unresponsive`; anything else passes through.
- reloadIfUncontrolled stays on as the last resort, for a worker that does
not answer CLAIM (a pre-0.5 /sw.js in a returning visitor's browser, a
custom serviceWorkerUrl). It costs nothing when the claim works.
- controlTimeoutMs is passed as the adapter's timeout; public exports
(mountEdge, UncontrolledPageError, DEFAULT_CONTROL_TIMEOUT_MS) unchanged.
- edge-reload.mjs: a hard reload must now recover with one load and one
navigation; a second origin serves a worker that ignores CLAIM to cover
the fallback reload and the spent guard. Chromium and Firefox pass.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
@statewalker/webrun-http-browserto^0.5.0(webrun-wire feat!: the membership token travels in x-httpeers-token, never Authorization #9, merge 485ad21) in httpeers-member (peer + dev), httpeers-browser-conformance, demos and llm-chat. A caret on 0.x pins the minor, so^0.4.xwould never have picked it up. The standalone lockfile changes only those edges.mountEdgerelies on the library. 0.5'sSwHttpAdapter.start()sends aCLAIMrequest that the stocksw-worker(every app's/sw.js) answers withclients.claim(), bounds every wait bytimeout, and rejects withServiceWorkerControlError. So the page-side pre-check and reload guard from fix(member): mountEdge recovers a page its ServiceWorker does not control (hard reload hang) #5 go; a hard-reloaded page is now taken over in place, with no navigation.edge-control.tsis now justedgeStartError:ServiceWorkerControlError(matched onname/reason, since every bundle carries its own copy of the class) →UncontrolledPageError("close the tab and reopen it") foruncontrolled, the existing actionableErrorforactivation-timeout/unresponsive, anything else unchanged. The library error is kept ascause.reloadIfUncontrolled: truestays, as the last resort. It covers a worker that does not answerCLAIM: a pre-0.5/sw.jsstill installed in a returning visitor's browser, or a customserviceWorkerUrl. It costs nothing when the claim works, and the library guards it withsessionStorageso it can't loop. The catch is that such a worker keeps the page waiting for the wholecontrolTimeoutMs(30 s) before the reload.mountEdge,UncontrolledPageError,DEFAULT_CONTROL_TIMEOUT_MS,controlTimeoutMs) are unchanged.main(it lives only in unmerged Session origins: {name}.p.httpeers.net shell, demo, infra #3), so there is nothing to remove. The apps copywebrun-http-browser/sw-workertosw.jsat build time, so a rebuild ships theCLAIMhandler.Tests
pnpm install --frozen-lockfile,lint:check,build,typecheckandtestall pass (member 116, llm-chat 119, hub 125, access 185, …).webrun-http-browseredgelink:): the same suite passes.test:reload(Playwright, Chromium + Firefox), both linked and against the published 0.5.0 tarball:controlledAtLoad=false, one load, 1 navigation;CLAIM: a hard reload does the one fallback reload (2 loads, 2 navigations, controlled). With the guard already spent it shows "close the tab and reopen it", with no reload. The normal reload after that recovers.test:browser: 11/11 (Chromium).🤖 Generated with Claude Code