Repository navigation
test(mobile): an offline cold start reads the grants of the last manifest accepted (OTA phase D, finding 7) - #22175
Conversation
The fake answers the file-system port the store is written against, and the offline-grant suite drives the same real store against it. Two in-memory trees answering one port differently is how a passing suite stops being evidence. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…fest accepted Finding 7 on #21503 end to end: the reducer, the runner, the real generation store and a disk, with only the network and the platform modules doubled. A grant-only edit keeps the bundle's build id, so the cached assets are right under a manifest an edit behind; the verdict measured here belongs to a second mount whose whole evidence is the tree on disk. Both directions of the edit and both arms: a widened grant list reaches the offline verdict, a revoked one is gone from it, and a manifest read under a wall is not written, so offline keeps the last grants this shell could use. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The store suite still spelled the local type name. `tsconfig.json` excludes test files, so only the tests-typecheck ratchet sees this. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe change adds a shared in-memory Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This change adds offline grant coverage and refactors test-only filesystem support without changing shipped product behavior, so it has no identified production impact and is ready to merge after normal checks. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description provides a detailed summary, rationale, linked issue reference, and verification results. However, it omits most required template sections, including ELI5, What Changed, Why, Linked Issue with a Fixes entry, Visual Proof with an N/A explanation, Testing, Review, Agent skill upstream boundary, Notes, and Checklist. Resolution Update the description to include all required template sections. Add concise ELI5, What Changed, and Why sections; use the Linked Issue section with the required issue reference; add Visual Proof with N/A and a reason because there is no UI change; add a Testing section with the automated and manual test status; complete Review, Agent skill upstream boundary, Notes, and Checklist sections.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This test-only PR closes finding 7 of #21503 with an end-to-end guard; the behavior it pins was already shipped by D1 (#22139), so nothing here changes the product.
- Four-arm offline verdict suite —
mobile-web-shell-offline-grant-staleness.test.tsmounts the real session hook over the real store over an in-memory disk, and asserts the offline cold start reads the grants of the last manifest the shell accepted (widen, revoke, never-read, and edit-under-a-wall). - Shared disk fake extracted — the in-memory
GenerationFileSystemmoves togeneration-file-system-fake.tsso both suites drive the real store against one fake; behavior is identical to the inline version. - Guard verified, not assumed — I confirmed the suite can fail: replacing the reducer's
persisteffect with[]inmobile-web-shell-session.tsfails arms 1 and 2 (storedRouteGrantsat line 238, androuteGrantsat line 266). Both touched suites pass locally (44 tests).
Worth noting the fixture discipline is what makes this real coverage rather than theatre: each mount mints a fresh store, goOffline() clears the staged manifest as well as the connection, and fixtures are parsed through MobileWebBundleManifestReadSchema so the build id is genuinely the asset digest.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Summary
Closes finding 7 from #21503 (offline route/grant staleness, deferred to Phase D) with a verdict test: D1 (#22139) already fixed it end to end. No product change; the test is the evidence and the guard.
mobile/src/mobile-web-shell/mobile-web-shell-offline-grant-staleness.test.tsmounts the realuseMobileWebShellSessionover the realcreateGenerationStoreon an in-memory disk. Only the RPC transport and the platform modules vitest cannot load are doubled. Generation G is written by the store's own stage-and-commit, each mount mints a fresh store sharing nothing but the on-disk tree, and every fixture is parsed throughMobileWebBundleManifestReadSchema, so the build id really is the digest of the assets and a manifest the phone could not have received is refused rather than measured.goOffline()clears the staged manifest as well as the connection, so a mount that reached the host would fail its flow instead of agreeing with disk by accident.Four arms, all green on main:
Mutation evidence: dropping the reducer's
persist-manifesteffect fails arms 1 and 2; skippingstore.persistActiveManifestin the runner fails arms 1 and 2; making the wall arm persist fails arm 4.The store suite's in-memory file system moves to
generation-file-system-fake.tsso both suites drive the real store against one fake; a leftover aliased type name from the extraction is fixed in its own commit (tests are outsidetsconfig.json, so only the ratchet saw it).Recorded for later, outside this finding: an already-mounted session never re-reads the manifest on a reconnect (
gates-changedstarts a flow only when the state awaits gates), so a grant edit reaches a live page on its next mount. Pre-existing; noted in the plan's follow-ups.Verification
Lane on the merged head: mobile tsc 0, ratchet 0 (811 files), full mobile 815 files / 9,066 passed, config/scripts 252 files, oxfmt 0, oxlint 0, anti-slop 0, changed-code quality 0 across 10 files, React Doctor 0.
Lead gate on ce92347 against 90d363a (gate-d2-ce92347252.log): tsc 0, ratchet 0, changed-code quality 0, react-doctor 0, anti-slop 0, max-lines 0, root-oxlint 0 (3 files), config/scripts 252 passed / 2 skipped, mobile 815 passed, machine-paths 0.