Skip to content

fix(web): reload up to three times on a failed chunk instead of dead-ending - #240

Merged
nullStack65 merged 3 commits into
release/native-0.1.10from
fix/clo-1310-boot-reload-retry
Nov 27, 2026
Merged

nullStack65 merged 3 commits into
release/native-0.1.10from
fix/clo-1310-boot-reload-retry

Conversation

@nullStack65

@nullStack65 nullStack65 commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

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. reloadOnceForChunkLoadError is renamed reloadForChunkLoadError because 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.ts and main.test.ts asserted 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.
  • Real browser: the QA spec layout.boot-recovery (added in the CLO-1299 harness PR) aborts assets/main-*.js for 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

…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>
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

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

Run configuration

  • 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

nullStack65 and others added 2 commits November 27, 2026 13:13
…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>
@nullStack65
nullStack65 merged commit 53ae52a into release/native-0.1.10 Nov 27, 2026
6 checks passed
@nullStack65
nullStack65 deleted the fix/clo-1310-boot-reload-retry branch November 27, 2026 13:53
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