Title: fix(webapp): recover from stale /build assets via a bounded reload by nicktrn · Pull Request #4282 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: fix(webapp): recover from stale /build assets via a bounded reload by nicktrn · Pull Request #4282 · triggerdotdev/trigger.dev
X Title: fix(webapp): recover from stale /build assets via a bounded reload by nicktrn · Pull Request #4282 · triggerdotdev/trigger.dev
Description: Problem
The webapp's HTML references content-hashed /build assets, and each running
instance contains exactly one build and returns 404 for asset hashes it doesn't
have. During a rolling deploy a client can hold HTML from one build while a
request for one of its assets is served by an instance on a different build →
missing styles or a failed chunk load.
What this does
On a /build stylesheet/script/chunk load failure, the client does a bounded
full-document reload (at most 2 per 5 minutes, tracked in sessionStorage) so
the page reloads onto a single consistent build. That's the whole mechanism — no
polling, no fetch interception, no blocking overlay, no form snapshotting.
apps/webapp/app/components/StaleAssetRecovery.tsx — authored as a typed,
lint-checked function and serialized to an inline script via .toString() (so
the logic is real, reviewable code, not an opaque string), injected before