Repository navigation
Draw the first preview on a first visit: wait for the worker - #229
Merged
Merged
Conversation
On a first visit the preview frame could load before the service worker was running. The frame's address is served only by the worker, so it got a 404 and stayed blank until the person pressed refresh. This was seen on the live site about half the time, and it was reproduced locally with network latency. The worker's registration is now kept, and the live frame waits until the worker runs or its install fails. When service workers are blocked, the register call rejects and nothing waits. Under latency the preview drew the app 3 times out of 3, where before it stayed blank 3 times out of 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3LdusN9UGDiUFDM7bZ
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
After #228, the live site turns an idea into an app with no dialog and no server. On a first visit, though, the preview often stayed blank until the person pressed refresh. The preview frame loaded before the service worker was running. Only the worker serves
/p/<kappa>/, so the frame got a 404.workerActive.liveFrame()waits for it, until the worker runs or its install fails.registerrejects and nothing waits.Evidence
<html><head></head><body></body></html>and the page had no worker in control.Generated by Claude Code