[CP Staging] fix Deeplink - App is stuck on splash screen when navigating to a public room as anon user#88733
Conversation
…lic room as anon user Co-authored-by: Copilot <copilot@github.com>
|
@ikevin127 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@codex review |
|
🤖 Code Review The fix looks correct. All checks pass. What changed: The Review notes:
|
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
There was a problem hiding this comment.
Pull request overview
This PR addresses an issue where navigating via deeplink to a public room as a signed-out (anonymous) user could leave the app stuck on the splash screen, by ensuring deep link handling waits until relevant Onyx keys have finished loading.
Changes:
- Update
DeepLinkHandlerto subscribe to Onyx metadata for several keys (REPORTcollection, session, conciergeReportID, introSelected, onboarding, betas). - Gate deep link processing on
isLoadingOnyxValue()across all required Onyx metadata to avoid running before hydration completes. - Refine the
useEffectdependency list to react to Onyx load status changes rather than raw Onyx values for some keys.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reviewer Checklist
Screenshots/VideosAndroid: mWeb Chromescreen-20260424-140933.mp4iOS: mWeb SafariScreenRecording_04-24-2026.14-10-16_1.MP4MacOS: Chrome / SafariScreen.Recording.2026-04-24.at.14.08.11.mov |
| @@ -27,16 +27,16 @@ type DeepLinkHandlerProps = { | |||
| function DeepLinkHandler({onInitialUrl}: DeepLinkHandlerProps) { | |||
There was a problem hiding this comment.
Observation: The component mixes side effects with data fetching logic.
Recommendation for Future Refactoring:
- Extract deep link handling logic into a custom hook:
// Suggested pattern
function useDeepLinkHandling(onInitialUrl: (url: Route | null) => void) {
const [allReports, allReportsMetadata] = useOnyx(ONYXKEYS.COLLECTION.REPORT);
// ... other useOnyx calls
useEffect(() => {
// Deep link handling logic
}, [/* deps */]);
}
function DeepLinkHandler({onInitialUrl}: DeepLinkHandlerProps) {
useDeepLinkHandling(onInitialUrl);
return null;
}This would improve testability and separation of concerns.
| @@ -27,16 +27,16 @@ type DeepLinkHandlerProps = { | |||
| function DeepLinkHandler({onInitialUrl}: DeepLinkHandlerProps) { | |||
There was a problem hiding this comment.
Current Coverage: 0% - No tests found for DeepLinkHandler.tsx
Recommended Test Suite:
// DeepLinkHandler.test.tsx
describe('DeepLinkHandler', () => {
it('should wait for all Onyx data to load before processing deep links', () => {
// Test loading gate
});
it('should not infinite loop when betas or introSelected change', () => {
// This would catch the regression
});
it('should process deep link when user is authenticated', () => {
// Test happy path
});
it('should handle public room deep link for anonymous users', () => {
// Test the specific bug scenario
});
it('should cleanup Linking event listener on unmount', () => {
// Test memory leak prevention
});
});
ikevin127
left a comment
There was a problem hiding this comment.
🟢 LGTM: only 2 NAB comments, can be handled later if need be
|
🚧 @mollfpr has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
[CP Staging] fix Deeplink - App is stuck on splash screen when navigating to a public room as anon user (cherry picked from commit e19e2f0) (cherry-picked to staging by mountiny)
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.3.62-4 🚀
Bundle Size Analysis (Sentry): |
|
🤖 No help site changes required. This PR is a purely internal bug fix in The existing help site articles ( |
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.3.62-5 🚀
Bundle Size Analysis (Sentry): |
|
🤖 No help site changes required. This PR is a purely internal bug fix — it ensures all Onyx values are fully loaded before processing deep links in |
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.3.64-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 No help site changes required. This PR is a pure internal bug fix — it corrects a race condition in I checked the existing help articles and the only mention of "public rooms" is an unrelated moderation note in |
|
Deploy Blocker #89028 was identified to be related to this PR. |
Explanation of Change
Fixed Issues
$ #88653
$ #88545
Tests
Precondition
A link to a public room (Or create one)
Offline tests
N/A
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-04-24.at.10.33.37.PM.mov