Repository navigation
fix(web): reload up to three times on a failed chunk instead of dead-ending - #240
Merged
nullStack65 merged 3 commits intoNov 27, 2026
Merged
Conversation
…ending A failed code chunk reloaded the page once per tab session and never again. If the reload hit the same network blip, the app stopped on "T3 Code failed to start", and a later blip in the same tab got no retry at all. On a busy host, 2 of 100 cold loads ended there, each after the one reload had already failed. The guard now allows three reloads in a 60 second window, 0.75 s apart and growing, counted per build. A chunk that is really gone still stops after three tries. A tab that stored the old bare build string is treated as having no record. Found by the CLO-1299 feature sweep as CLO-1310. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
…the new contract Review of the first commit found that one failed load raises a preload error per lost chunk, so a single document could spend all three reloads and arm three timers. Those events now share one scheduled reload. A 60 second window also let a load that hangs and then fails every 20 seconds reload forever; the window is ten minutes, so three tries cover a flapping network and a slow failure still stops. Stamps from a clock that moved back no longer hold the cap shut. bootstrap.test.ts and main.test.ts still asserted the one-reload contract and a bare build string; they now cover three tries, the spent budget, and the delayed reload. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Nov 27, 2026
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.
Problem
A failed code chunk reloaded the page once per tab session and never again. If that reload hit the same network blip, the app stopped on "T3 Code failed to start / We are not sure why", and a later blip in the same tab got no retry at all. Every load fetches about 100 chunks, so a tunnel, Wi-Fi or tailnet change is enough. Measured on
release/native-0.1.10(built web client, Chrome 158): 2 of 100 cold loads on a busy host ended on that screen, both with the guard already spent (sessionStorage["t3code:chunk-load-reloaded"]set, 2 main-frame navigations). A full 248-load feature sweep hit it 7 times (2.8%).Cross-family review (Grok 4.7) found the two correctness issues fixed in the second commit.
Tracking: CLO-1310 (found by the CLO-1299 feature sweep).
Fix
The guard now allows three reloads in a ten minute window, delayed 0.75 s and growing, counted per build in sessionStorage. The many preload errors one failed load raises share a single scheduled reload, so one flaky document cannot spend the whole budget. A chunk that is really gone, or a load that hangs and then fails every few seconds, still stops after three tries. A tab that stored the old bare build string, or a stamp from a clock that moved back, is treated as having no record.
reloadOnceForChunkLoadErroris renamedreloadForChunkLoadErrorbecause it no longer reloads once.Proof
vp test run src/lib/chunkReloadGuard.test.ts src/bootstrap.test.ts src/main.test.ts: 15 pass.bootstrap.test.tsandmain.test.tsasserted the old one-reload contract and are updated; new cases cover retry with growing delays then surface, a load failing every 20 s, window expiry, clock moved back, many preload errors from one load, legacy value and blocked storage.layout.boot-recovery(added in the CLO-1299 harness PR) abortsassets/main-*.jsfor the first document and the first automatic reload. On the base build the boot error screen stays; with this change the app mounts after the second reload.Deploy: fleet
🤖 Generated with Claude Code