fix(mobile): serialize development account replacement - #5641
Open
iscekic wants to merge 1 commit into
Open
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (13 files)
Reviewed by grok-4.6 · Input: 163.2K · Output: 28.7K · Cached: 592.9K Review guidance: REVIEW.md from base branch |
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.
No new behavior — this level changes development tools and automated checks, not the released app.
Summary
DevSessionReplacementserializes development account changes through sign-out anduseDevSessionLoginCommit, so the previous account's authenticated subscriptions finish cleanup before sign-in.The
Admissioncontract supplies identity, consent, and shell readiness;useDevSessionNavigationalso checks token ownership and the authentication epoch.Failures before enqueueing release the request; queued failures or a missing commit after 15 seconds block replacements until restart, with credential-free reports.
Files
apps/mobile/src/components/dev-session-injector.tsx— coordinates replacement across bootstrap, Strict Mode replay, and remounts; validates admission and reports sanitized outcomes (M; Source; 280 changed lines).apps/mobile/src/app/(auth)/login.tsx— marks login readiness after passive cleanup and clears readiness on unmount (M; Source; 2 changed lines).apps/mobile/src/components/dev-session-injector.mounted.test.tsx— covers cleanup, paired ingress, installed Expo queuing, commit correlation, readiness checks, failures, and remounts (A; Test; 911 changed lines).DevSessionRequestpairs credentials, destination, and request ID;DevSessionSnapshotexposes the pending request, active replacement, and login readiness.takeDevSessionFromUrlgains optional destination and initial-delivery arguments and returns acceptance;consumePendingDevSessionnow returns a request instead of credentials.Duplicate cold deliveries do not replay, only the latest waiting pair survives, and credential-only links still default to Home.
Files
apps/mobile/src/lib/dev-session-inject.ts— adds request snapshots, latest-pair retention, cold deduplication, and committed-route matching (M; Source; 123 changed lines).apps/mobile/src/lib/dev-session-inject.test.ts— updates consumed request expectations and covers Home defaults, cold deduplication, and latest-pair retention (M; Test; 46 changed lines).useDevSessionNavigationblocks ordinary destinations during replacement and appendsDEV_SESSION_MARKER(__dev_session_request) only to an admitted navigation action.isDevSessionDestinationCommittedchecks the selected, complete route, request marker, tab group, and encoded detail parameters rather than a pathname or dispatch return.Root navigation remains the only dispatcher and keeps anchored navigation; development dispatch failures reject the request, while ordinary navigation errors still propagate.
Files
apps/mobile/src/app/_layout.tsx— checks readiness before consuming destinations and preserves anchored dispatch with development-specific failure handling (M; Source; 31 changed lines).redirectSystemPathandcaptureLaunchDeepLinkcapture development credentials with their destination before publishing ordinary navigation, and handled credential links never return to Expo routing.setPendingDeepLinkaccepts an optionaldevRequestId, whichgetPendingDeepLinkRequestIdexposes only in memory;PendingDeepLinkRecordkeeps its existing shape.Existing deep links, notification precedence, persisted destinations, and release behavior remain compatible; consuming or clearing a destination also clears its development request ID.
Files
apps/mobile/src/lib/deep-link-handler.ts— captures paired requests before ordinary routing and suppresses credential URLs when resolution fails (M; Source; 10 changed lines).apps/mobile/src/lib/deep-link-launch.ts— captures paired launch requests, keeps request IDs in memory, and clears IDs on consumption or reset (M; Source; 21 changed lines).apps/mobile/src/lib/deep-link-handler.test.ts— asserts paired capture and credential suppression when routing fails (M; Test; 17 changed lines).apps/mobile/src/lib/deep-link-launch.test.ts— covers paired launch capture and persistence without credentials or request IDs (M; Test; 31 changed lines).Both continuous integration (CI) workflows now accept
pull_requestevents against any base branch, so stacked pull requests receive checks.pushremains restricted tomain;workflow_call, read-only permissions, and existing mobilepathsfilters remain intact, with workflow-contract changes also triggering mobile checks.Both workflows run
Check stacked CI admissionunconditionally after dependency installation; its trigger-contract tests fail the job when admission rules or invocation placement change.Files
.github/workflows/ci.yml— removes the base restriction and checks trigger contracts before change filtering (M; Source; 4 changed lines)..github/workflows/kilo-app-ci.yml— removes the base restriction, extends both path filters, and checks trigger contracts before mobile tests (M; Source; 8 changed lines).scripts/stacked-ci.test.mjs— validates trigger admission, path filters, permissions, reusable calls, and unconditional check placement (A; Test; 163 changed lines).Tests: 5 files changed:
dev-session-injector.mounted.test.tsxandstacked-ci.test.mjsadded;dev-session-inject.test.ts,deep-link-handler.test.ts, anddeep-link-launch.test.tsmodified.Generated: 0 files changed.
Verification
Visual Changes
Visual Changes: N/A
Reviewer Notes
Human steps
mobile-openrequest.mobile-openrequest.Focused checks
Scope and file inventory
Kilo-Org/cloud./Users/igor/Projects/.worktrees/mobile-live-loading-2be5.mobile-live-loading-2be5, commitde4bd200d, compared withorigin/main.Notes
Runtime verification is pending on the stack tip; this level has focused test coverage only.
Stacked PRs — merge bottom to top. Each level shows only its own diff.
Runtime verification (E2E, user advocacy, simplify) runs on the tip PR over every level.
Every level keeps its own checks, its own bot review, and its own threads; each one is answered on its own PR.
Each level is its own deliverable: it builds and passes its own checks alone.
A finding on a level is repaired on that level, then carried upward with stack.sh forward.
mobile-live-loading-2be5— fix(mobile): serialize development account replacement #5641 ← this PRmobile-live-loading-2be5-s2— fix(mobile): track accepted live query outcomes #5649 (tip)