Fix Android workspace restore after process recreation#2384
Open
evilcoda wants to merge 1 commit into
Open
Conversation
Contributor
|
| Filename | Overview |
|---|---|
| packages/app/src/app/_layout.tsx | Routes successful offer imports through the paired host root while preserving cancellation and error handling. |
| packages/app/src/navigation/offer-link-navigation.ts | Introduces a small route resolver that rejects invalid profiles and builds an encoded host-root route. |
| packages/app/src/navigation/offer-link-navigation.test.ts | Covers valid routing and rejection of missing or non-string server IDs. |
Sequence Diagram
sequenceDiagram
participant A as Android / offer link
participant L as OfferLinkListener
participant H as Host runtime
participant R as Expo Router
participant S as Host startup policy
A->>L: Deliver pairing URL
L->>H: Import and upsert offer
H-->>L: Host profile with serverId
L->>R: replace(/h/serverId)
R->>S: Enter paired host root
alt Remembered workspace exists
S->>R: Open remembered workspace
else No remembered workspace
S->>R: Open project setup
end
Reviews (1): Last reviewed commit: "fix(app): restore workspace after Androi..." | Re-trigger Greptile
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.
Fixes #2383.
Problem
After Android reclaims the app process, reopening Paseo can replay the Activity's original pairing intent.
OfferLinkListenerimports that stale offer again and then unconditionally navigates to the global project setup route, overriding the remembered workspace restored during startup.Change
Route successful offer imports through the paired host root instead of directly to global project setup. The existing host startup policy then:
The route decision is isolated in a small navigation helper with focused tests, including invalid profile handling.
Reproduction evidence
The bug was reproduced consistently on Android v0.2.0-beta.3 with a v0.2.0-beta.3 workstation. A screen recording shows the app process-recreation splash followed by the unexpected Add project screen.
QA
npm --workspace @getpaseo/app test -- src/navigation/offer-link-navigation.test.ts src/navigation/host-runtime-bootstrap.test.ts --bail=1— 29 tests passednpm run typecheck— passednpm run lint— passed with 0 warnings and 0 errorsnpm run format:files -- packages/app/src/app/_layout.tsx packages/app/src/navigation/offer-link-navigation.ts packages/app/src/navigation/offer-link-navigation.test.ts— passedThe original bug was reproduced on Android. The patched branch has not yet been installed on a physical Android device; automated coverage verifies the navigation policy and existing workspace restore behavior.