Repository navigation
fix(shell): 404 for a missing /assets/ file, new shell file names, one reload when the shell fails to load - #4413
Conversation
…ll's files, and reload once when the shell fails to load app.ovis.sh answered a hashed file its deployment lacked with index.html as a 200 under the assets' year-long immutable caching. A phone that asked for shell-2Jhdistb.css during the 0.5.8 deployment kept the page as that stylesheet, the browser refused it (nosniff), and Vite's 'Unable to preload CSS' took the shell to the crash screen on every start. - assets/404.html: Pages now answers a missing /assets/ file with a 404, and drops any Cache-Control on a 404 for no-store; the Caddy site pins only files that exist. - The shell's hashed files take ten hash characters, so none reuses an address 0.5.8 served (514 of 604 names were unchanged). - The relay boot reloads once (sessionStorage guard) when the shell's code fails to load, then shows a small Try again notice instead of the crash screen. - scripts/pages-static.ts answers a missing file as Pages does (404.html walk, single-page fallback, no-store on 404).
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
…its notice in the device's language Gate review of 2801b22: the guarded reload reloaded the address boot had already stripped, so a pairing offer, a sign-in's return or a query was lost (a pairing link landed on Add a PC). reloadEntry puts the entry address back before reloading; the reloaded page strips it again. AppLoadFailed shows before SettingsProvider set the language, so it reads the saved language itself. pages-static walks the decoded path for 404.html, as Pages does.
…, from the notice too Gate review of bdffae2: Try again reloaded the stripped address (an offer or a sign-in's return was lost), restoring the raw entry sent a private query to the host again, and a navigation while the shell loaded was undone. reloadAddress keeps the entry's offer or sign-in return, moves a query into the fragment as takeEntryUrl does, and gives no address once the tab navigated; the automatic reload and Try again both use it.
…ell load reloads Gate review of 7c04735: /s/<id>/?pane=p1&view=terminal#offer=... lost its offer on the reload, because reloadAddress kept only the query in the fragment. The offer takes the whole fragment, so an entry whose fragment is an offer, a sign-in link or a sign-in's return reloads with that fragment and drops the query; the query is never sent again.
Reviews of recordCodeRabbit reviewed the first head (2801b22, no actionable comments) and skipped the later ones, so the reviews of record for the final head b305d2b are:
Gate findings and how each was resolved:
Each fix has a unit test in |
|
Merged through Reviews of record at b305d2b: dori review (omo) CLEAR; omo gate reviewer (GPT-6.2 Astra) CLEAR after 4 rounds, every finding fixed with tests and browser repros (see the review-record comment). CodeRabbit reviewed 2801b22 with no actionable comments and skipped later heads. On the owner's standing rule (two reviews, no Codex) and the lead's word (freeze allow-list, merge when green). |
Release 0.5.9, on the owner's word (2026-11-21, relayed by the lead: release once #4377, #4412 and #4416 are merged; he tests on the real release). Step 2 is on by default from this release (#4377), with the Add this PC relist fix (#4412) and the relay tab's buttons and one-line account (#4416). The hosted shell fix for the Android preload failure (#4413) ships as a new app.ovis.sh build (app.ovis.sh is rolled back to 0.5.7's deployment until then). - `package.json` and `herdr-plugin.toml`: 0.5.8 -> 0.5.9. - `REMOTE_BUNDLE_VERSION` 52 -> 53 (`shared/machines.ts`): `server/` and `shared/` changed since `remote-v52`. After this merges, `remote-v53` is tagged on the merge commit and the Remote PC bundles run publishes it before the Release run. Until the Release run is done, nothing touching `server/`, `shared/`, `bun.lock` or `patches/` merges. - `CHANGELOG.md`: `bun scripts/changelog-fold.ts 0.5.9` folded the fragments under 0.5.9 with their PR links. #4412 has no fragment; its Fixed line was added by hand with its link. No `by @login` credits: every PR in the section is the maintainer's. - `release-summaries.json`: 0.5.9 in en, ko, ja and zh: 5 new, 2 improved, 3 fixed. The new lines say what step 2 does for people (sign in once and the account's PCs open from any device; a 10 s check for a new device, usually; a notice with Not me on the older devices; PCs not in an account work as before; how to turn it off with `OVIS_ACCOUNT_OPENS_ALL=0`). Left out of the summary on purpose (they stay in the changelog): the desktop app's built-in browser (off by default), strict mode as one row, and Sign in again in Add this PC's wait. - `telemetry/deployed.json` unchanged: release guards agree. ## Validation - `bun run check fast` on the remote heavy host (hosthatch) at this release commit on main e00f838: every step ok (unit: 22226 pass, 0 fail, 45 skip). - `bun test scripts/changelog-fold.test.ts scripts/release-notes.test.ts server/release-notes.test.ts scripts/release-guards.test.ts`: 60 pass, 0 fail. - `bun scripts/release-guards.ts --base origin/main`: "Release 0.5.9: remote bundle, telemetry Worker and release metadata are in order." - `bun scripts/release-notes.ts 0.5.9` renders the notes (New features 5, Improvements 2, Bug fixes 3). - Earlier on this branch: an app.ovis.sh incident rollback to 0.5.7's Pages deployment 44cabf26; this release replaces it with a new build from release.yml. - Not run: `check full` (the diff is versions, notes and one constant).
What broke
Two Android phones got "Something went wrong" /
Unable to preload CSS for https://app.ovis.sh/assets/shell-2Jhdistb.csson every start of 0.5.8, though the file answered 200 text/css to curl.Cause, reproduced: app.ovis.sh (Cloudflare Pages, no 404.html) answers a file its deployment lacks with
index.html, status 200, and the/assets/*rule addsCache-Control: public, max-age=31536000, immutable(plusnosniff):A phone that asked for
shell-2Jhdistb.csswhile the deployment did not serve it yet kept the page as that stylesheet for a year. The browser refuses it (text/html with nosniff), and Vite's preload throws, sobootRelayShelldrew AppCrash. The phone never asks again. A Chromium repro on the real v0.5.8dist-shell(the shell CSS answered once with the page under those headers, then correctly) crashes on opens 1, 2 and 3, and the server sees one request. Not the native shell: desktop Chromium with the Android app's opening probe does not reproduce, and 0.5.7 already lazy-loadedshell-DjCZ9LVt.cssthe same way.The fix
scripts/shell-build.ts): the shell shipsassets/404.html. Pages looks for the nearest 404.html above a missing path, so a missing/assets/*file is now a 404. Pages replaces any Cache-Control on a 404 withno-store(workers-sdkpages-shared/asset-server/handler.ts), so the next load asks again. Every other path keeps the single-page fallback. The Caddy site (regional mirror) now pins only files that exist (filematcher); a missing one isno-store. Pages already keeps assets of earlier deployments for a week (its asset preservation cache), so old hashed files stay reachable after a deploy./assetsnames identical to 0.5.8,shell-2Jhdistb.cssamong them, so 0.5.9 would hit the poisoned cache again. The shell's hashed files (code, styles, workers) now take ten hash characters instead of eight, so none reuses an address 0.5.8 served. After this change onlytheme-bootstrap-f10f765732.jskeeps its name: it is a classic script, and if refused the page draws with the default theme.src/lib/relay/boot.ts): when the shell's code fails to load, the page reloads once (guarded in sessionStorage, cleared by a successful load). If it fails again, it shows a small notice with Try again instead of the crash screen. No retry inside the page: Chrome keeps a failed import's answer for the page's life, and Vite's loader skips a stylesheet it already tried.scripts/pages-static.ts(the loopback Pages the browser regressions use) now answers a missing file as Pages does: the 404.html walk, then the single-page fallback, with no-store on any 404. Before, it gave a plain 404 that Pages never sends, which hid this bug.Design reference: the Codex and Claude apps show a small inline retry state when the app shell fails to load, not a crash report; this follows that.
Before / after
On the Android emulator (Chrome 145, Android 17 image), with the shell stylesheet answered as the page under the immutable header: v0.5.8 shows "Something went wrong" on every open (the server saw one request across two opens). This branch shows "Ovis could not load. Check your connection, then try again." with a Try again button. Screenshots were handed to the lead.
Review fixes (bdffae2)
reloadEntrynow restores the entry address before reloading, and the reloaded page strips it again. Repro: a valid/s/<id>/#offer=...with the first shell CSS missing now reloads once and shows "Pair with ?"; before the fix it showed "Add a PC".AppLoadFailedrenders before SettingsProvider sets the language, so it now resolves the saved/system language itself (the ko notice is tested).pages-staticwalks the decoded path for 404.html, as Pages does.Review fixes, round 2 (7c04735)
reloadAddressnever sends the entry's query to the host again: the query moves into the fragment, astakeEntryUrlkeeps it. It returns no address once the tab navigated while the shell loaded, so that navigation stays./?file=...with one miss -> the second document request is/;/#pcs->/#addwhile loading -> the reload stays at/#add.Review fixes, round 3 (b305d2b)
/s/<id>/?pane=p1&view=terminal#offer=...) keeps its offer on the reload. The offer takes the whole fragment, so the legacy query (a pane or a view) is dropped and never sent again. Repro: with 0, 1 or 2 misses plus Try again, every run shows "Pair with ?", and the reload documents carry no query.Validation
scripts/pages-static.test.ts(a missing/assets/*-> 404no-store; present -> 200 immutable),scripts/shell-build.test.ts(404 page, ten-character names for code and workers, Caddyfilematchers),src/lib/relay/boot.test.ts(reload once, then the notice until a load succeeds; no reload when storage refuses).dist-shellserved throughpages-static.ts): missing-once -> one reload, shell loads styled, no crash; always-missing -> one reload, then the notice, no loop; old poisoned entry (HTML, immutable) -> the notice, not the crash screen. The same poisoned entry on v0.5.8 -> crash screen.bun run check fastat b305d2b (old-desktop): workflow syntax, generated types/themes, typecheck, build, unit tests (21992 pass, 0 fail, 50 skip), actionlint: all ok.