You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-06-12] [$250] Public room - Public room not display in LHN after anon user login from a thread of public room #90536
When an anonymous user signs in from a public room thread, the SignInModal calls openApp(shouldKeepPublicRooms=true), which preserves the public room report in Onyx via a merge in App.ts:380-393. However, the preserved report still contains the anonymous user's accountID in its participants field — the newly authenticated user is not a participant.
When getReportNotificationPreference looks up the authenticated user's accountID in report.participants, it doesn't find it and defaults to HIDDEN. The LHN then filters it out via isHiddenForCurrentUser.
There is no mechanism to auto-join the parent public room after the anonymous-to-authenticated transition. The SignInModal navigates to ROUTES.HOME after sign-in, the OnboardingGuard redirects new users to onboarding, and the user never returns to the public room context.
What changes do you think we should make in order to solve the problem?
In SignInModal, before navigating to ROUTES.HOME, we should find any public room reports preserved in Onyx (via the same isPublicRoom check used by shouldKeepPublicRooms) where the current authenticated user is NOT in the participants, and call joinRoom for each of them. This ensures the server adds the authenticated user as a participant with a visible notificationPreference, so the public room appears in the LHN after sign-in completes.
The join should happen after openApp finishes (i.e., when IS_LOADING_APP becomes false) but before navigation to HOME, so the room is already joined by the time the LHN renders.
What alternative solutions did you explore? (Optional)
Modify shouldKeepPublicRooms to also update the participants field — This would be a client-only optimistic fix and wouldn't actually register the user as a participant on the server. The report would still be missing from the server's response on subsequent OpenApp calls.
Navigate back to the public room after onboarding instead of HOME — This only addresses the navigation aspect but doesn't fix the HIDDEN notification preference, so the room still wouldn't appear in the LHN sidebar.
Re-fetch the parent public room report via OpenReport after sign-in — This would load fresh data but still wouldn't join the user to the room, so the notification preference issue would persist.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
🚨 Edited by proposal-police: This proposal was edited at 2026-05-13 16:49:46 UTC.
Replaces my earlier proposal. The earlier body correctly followed the anonymous sign-in/OpenApp path, but the proposed parent OpenReport refresh was incomplete: the room stays hidden until the signed-in account gets a visible notification preference through the existing join path.
Proposal
Please re-state the problem that we are trying to solve in this issue.
After an anonymous user opens a public room, enters one of its threads, signs in as a new user, completes onboarding, and goes to Inbox, the parent public room is missing from the LHN.
What is the root cause of that problem?
In this repro the user opens the parent public room first, then enters a thread from that room. So the parent room is already in Onyx before sign-in. SignInModal then switches the anonymous session into a signed-in session and calls openApp(true):
That preserved report does not have a visible participants[currentUserAccountID].notificationPreference for the newly signed-in account. getReportNotificationPreference() therefore falls back to HIDDEN:
The missing step is not another OpenReport read. The existing client path that turns a hidden public room into a joined/visible room is joinRoom(), which calls updateNotificationPreference() and writes participants[currentUserAccountID].notificationPreference optimistically before sending UPDATE_REPORT_NOTIFICATION_PREFERENCE:
What changes do you think we should make in order to solve the problem?
In SignInModal, remember the report the user was viewing when the anonymous session becomes signed in, then join that public room before navigating Home after OpenApp finishes.
Concretely:
Add a ref such as signInOriginReportIDRef and set it to Navigation.getTopmostReportId() in the first sign-in effect before calling openApp(true).
Subscribe to ONYXKEYS.COLLECTION.REPORT in SignInModal.
In the isLoadingApp === false effect, derive the report to join from that origin report ID: if the origin report is a chat thread, use its parentReportID; otherwise use the origin report itself.
If that derived report is a valid public room and it is still hidden for the newly signed-in account, call joinRoom(publicRoomReport, session.accountID) before Navigation.dismissModal() and Navigation.navigate(ROUTES.HOME).
Scope boundaries:
Files touched: src/pages/signin/SignInModal.tsx - imports for joinRoom and report helpers, a sign-in-origin ref near the current refs, the current sign-in effect at lines 39-48, and the post-OpenApp navigation effect at lines 55-62.
Platforms: all platforms through the shared sign-in modal; the reported Windows/Chrome path is covered.
Code paths explicitly not touched: ReportFetchHandler, openReportFromDeepLink, openApp public-room preservation, onboarding guards, generic LHN filtering, non-public reports, and unrelated public rooms that were not the sign-in origin.
API contracts or backend behavior changes: no; this reuses the existing joinRoom -> UPDATE_REPORT_NOTIFICATION_PREFERENCE path.
What alternative solutions did you explore? (Optional)
My earlier ReportFetchHandler/parent OpenReport refresh is not enough because it only re-reads report data. It does not write the signed-in account's visible notification preference, so the LHN can still treat the room as hidden after Home navigation.
MobileMage and aswin-s point at openReportFromDeepLink not fetching the parent room. That would matter for a direct thread deep link, but the reported flow and video open the parent public room first, so the parent report is already present before sign-in.
MelvinBot and trasnake87 use the right join mechanism, but they join every preserved public room. I would scope the auto-join to the report the user signed in from, or that report's parent when the origin is a thread, so an unrelated public room visited earlier in the anonymous session is not silently joined.
changed the title [-]Public room - Public room not display in LHN after anon user login from a thread of public room[/-][+][$250] Public room - Public room not display in LHN after anon user login from a thread of public room[/+]on May 13, 2026
Please re-state the problem that we are trying to solve in this issue.
When an anonymous user navigates directly to a thread inside a public room and then signs in with a new account, the parent public room does not appear in the LHN after onboarding completes, even though the thread itself was the entry point to the app.
What is the root cause of that problem?
When an anonymous user opens a deep link pointing to a thread (e.g. /r/<threadReportID>), openReportFromDeepLink in Link.ts calls openReport with only the thread's reportID. The server's OpenReport response populates Onyx with data for the thread but does not necessarily populate a standalone report entry for the parent public room under ONYXKEYS.COLLECTION.REPORT<parentReportID>.
When the user subsequently signs in via the sign-in button, SignInModal calls openApp(true) (with shouldKeepPublicRooms = true). The getOnyxDataForOpenOrReconnect function in App.ts scans the current allReports Onyx collection to find any public rooms and adds them to successData so they survive the OpenApp report-list reset. Because the parent public room was never written to allReports as its own entry (only the thread was opened), the scan at line 381 of App.ts finds nothing to preserve. After OpenApp completes, the new user's server-side report list does not include the public room (they have not explicitly joined it), so the parent public room is absent from the LHN entirely.
What changes do you think we should make in order to solve the problem?
In openReportFromDeepLink in src/libs/actions/Link.ts, after calling openReport for the deep-linked report, the code should check whether that report is a thread (i.e. it has a parentReportID) and, if so, also call openReport for the parentReportID. At the time openReportFromDeepLink executes, the thread report may already be in the reports collection passed as a parameter; if so, the parentReportID can be read directly. If the thread is not yet in the collection (it is being fetched for the first time), the code should subscribe to the Onyx key for the thread report and, once it arrives with a parentReportID, call openReport on that parent. This ensures the parent public room is written into allReports before openApp(true) fires in SignInModal, so the shouldKeepPublicRooms preservation logic at line 381 of App.ts can find it and add it to successData.
Concretely, after the openReport({reportID, ...}) call at line 245 of Link.ts, add logic that reads reports?.[ONYXKEYS.COLLECTION.REPORT + reportID]?.parentReportID and, if present (meaning the report is a thread with a known parent), calls openReport({reportID: parentReportID, isFromDeepLink: false, ...}). If the parent is not yet available, use Onyx.connectWithoutView on the thread report key and trigger the parent openReport call as soon as the thread data arrives with a parentReportID, disconnecting immediately after. This mirrors the existing pattern used elsewhere in Link.ts (lines 351–360) to wait for report data before acting.
// If we're not opening a public room (no reportID) or the user is authenticated, we unblock the UI (hide splash screen)
doneCheckingPublicRoom();
}
What alternative solutions did you explore? (Optional)
An alternative would be to extend the shouldKeepPublicRooms logic in getOnyxDataForOpenOrReconnect to also walk the parentReportID chain of any reports currently in allReports and preserve those ancestor reports if they are public rooms. This would catch the case without modifying the deep-link flow, but it adds complexity to a function that runs on every OpenApp and ReconnectApp call, whereas fixing the deep-link entry point is more targeted and correct by design. Another option would be to have the server return the parent report as part of the OpenReport response for threads — but that is a backend change outside the scope of this issue.
Please re-state the problem that we are trying to solve in this issue.
When an anonymous user opens a deep link to a thread inside a public room (e.g., /r/<threadID>), signs in as a new user, and completes onboarding, the public room does not appear in the LHN. The user expects the public room to be visible alongside other accessible rooms after sign-in, but instead only their joined rooms are shown because the parent public room was never written to Onyx during the anonymous deep-link flow.
What is the root cause of that problem?
In src/libs/actions/Link.ts:244–246, when openReportFromDeepLink is called with a thread reportID, it only calls openReport for that thread. The server returns thread data, but the parent public room is never fetched or stored in allReports as a standalone entry. Later, when SignInModal calls openApp(true) (src/pages/signin/SignInModal.tsx:48), getOnyxDataForOpenOrReconnect in App.ts:380 filters allReports for public rooms:
Since the thread is not itself a public room and the parent public room is absent from Onyx, this filter matches nothing. After openApp resets the report collection, the newly signed-in user's server-supplied report list also lacks the public room (the user has not joined it), so it never appears in the LHN.
What changes do you think we should make in order to solve the problem?
File:src/libs/actions/Link.ts Function:openReportFromDeepLink Description: After the initial openReport({reportID, ...}) call for the thread, fetch the parent public room using the following logic:
Subscribe to the thread's Onyx key (ONYXKEYS.COLLECTION.REPORT + reportID) using Onyx.connect. Store the connection ID so it can be disconnected after use, preventing memory leaks and infinite loops.
In the callback, check that report?.parentReportID is a non-empty string before proceeding. If parentReportID is absent or falsy, disconnect and return early — this guards against threads that have no parent or whose parent field has not yet been hydrated.
Once a valid parentReportID is confirmed, disconnect the Onyx listener immediately (call Onyx.disconnect(connectionID)) before firing any further action, ensuring the listener fires at most once and cannot loop.
Call openReport({reportID: report.parentReportID, isFromDeepLink: true, ...}) to fetch and cache the parent public room. This ensures the parent public room is written to allReports before SignInModal triggers openApp(true), allowing getOnyxDataForOpenOrReconnect to find and preserve it.
Sketch of the addition (immediately after the existing openReport call for the thread):
This pattern is safe across both web and mobile: Onyx.connect is the same cross-platform primitive used throughout the codebase for one-time data reads, and disconnecting in the callback before dispatching the side-effect is the standard idiom for avoiding re-entrancy. There is no platform-specific Onyx behavior in this path that requires separate handling.
What alternative solutions did you explore? (Optional)
When an anonymous viewer of a public room signs in (or signs up) from within a thread of that room, the public room remains in Onyx but never appears in the LHN of the newly authenticated session.
Root cause
Two pieces of logic combine to produce the bug.
1 - Public room is preserved in Onyx, but the new account is not a participant
SignInModal triggers openApp(true) once the session transitions out of ANONYMOUS, so the public room is intentionally re-merged into Onyx as part of OpenApp's successData — src/pages/signin/SignInModal.tsx:39-49:
// src/pages/signin/SignInModal.tsx:39-49useEffect(()=>{constisAnonymousUser=session?.authTokenType===CONST.AUTH_TOKEN_TYPES.ANONYMOUS;if(!isAnonymousUser){hasSignedInRef.current=true;// To prevent deadlock when OpenReport and OpenApp overlap, wait for the queue to be idle before calling openApp.waitForIdle().then(()=>openApp(true));}},[session?.authTokenType]);
The merge happens in src/libs/actions/App.ts:377-390:
The report object that is re-merged is the one that was fetched while the viewer was anonymous: its participants map does not contain the freshly created account's accountID. OpenApp's normal response only carries reports the new account is actually a member of, and a public room visited as an anonymous user is not one of them — so nothing in the response writes a participant entry for the new account either.
2 - Missing participant entry collapses notificationPreference to HIDDEN, which LHN filters out
getReportNotificationPreference reads the preference off the current user's slot in report.participants — src/libs/ReportUtils.ts:1888-1897:
With no entry for the new accountID, this returns HIDDEN. isHiddenForCurrentUser (src/libs/ReportUtils.ts:2223-2234) then returns true, and SidebarUtils.getOptionData drops the report at src/libs/SidebarUtils.ts:303 / :331-333 because none of the shouldOverrideHidden conditions (draftComment, focused, pinned, system chat, requiresAttention, errors, own policy expense chat) apply to a public room the user has just been signed-in to:
Net effect: the room sits in Onyx with no participants[newAccountID], the LHN treats it as hidden, and the user only sees an empty Inbox after onboarding even though they explicitly chose to sign in from inside that room.
Proposed fix
After openApp finishes (i.e., once IS_LOADING_APP flips back to false), iterate over the public rooms that shouldKeepPublicRooms just preserved and call joinRoom for any where the newly authenticated accountID is not already a participant. joinRoom already wraps updateNotificationPreference, which short-circuits when previousValue === newValue (src/libs/actions/Report/index.ts:3078-3081), so it is a no-op for rooms the user is already a member of.
Update src/pages/signin/SignInModal.tsx so the second useEffect joins any preserved public rooms before dismissing the modal:
The participant guard (report?.participants?.[currentUserAccountID]) keeps the call to joinRoom cheap and avoids redundant UpdateReportNotificationPreference writes for users who happened to revisit the same room from a non-anonymous session. joinRoom itself resolves the correct preference for the room type via getDefaultNotificationPreferenceForReport (DAILY for public rooms, ALWAYS for public-announce — src/libs/ReportUtils.ts:1869-1886), so both VISIBILITY.PUBLIC and VISIBILITY.PUBLIC_ANNOUNCE are handled correctly. The optimistic data in updateNotificationPreference (src/libs/actions/Report/index.ts:3083-3095) immediately writes participants[currentUserAccountID].notificationPreference = DAILY, which un-hides the room in the LHN on the very next render — i.e., before the user even taps the Inbox tab.
Why this approach
Doing the join on the client mirrors what already happens elsewhere in the app when a logged-in user enters a public room and presses the "Join" promoted action (src/components/PromotedActionsBar.tsx:65-73 and src/pages/inbox/HeaderView.tsx:198) — we reuse the same joinRoom → updateNotificationPreference → UPDATE_REPORT_NOTIFICATION_PREFERENCE path that the server already understands, so the user becomes a real participant on the backend rather than only locally. Two alternatives were considered and rejected: (a) injecting a participant entry directly into the successData of openApp in App.ts:377-390 would un-hide the room only locally and would be wiped by the next ReconnectApp because the backend wouldn't know the user joined; (b) auto-navigating back to the originating public room URL instead of ROUTES.HOME would conflict with OnboardingGuard's redirect for new accounts and would not handle the case where the anonymous session had visited multiple public rooms. Gating the call on isLoadingApp === false ensures the shouldKeepPublicRooms merge in OpenApp's successData has already run, so we are joining the same set of rooms that were preserved rather than racing against the queue.
Activity
MelvinBot commentedon May 13, 2026
Proposal
What is the root cause of that problem?
When an anonymous user signs in from a public room thread, the
SignInModalcallsopenApp(shouldKeepPublicRooms=true), which preserves the public room report in Onyx via a merge inApp.ts:380-393. However, the preserved report still contains the anonymous user's accountID in itsparticipantsfield — the newly authenticated user is not a participant.When
getReportNotificationPreferencelooks up the authenticated user's accountID inreport.participants, it doesn't find it and defaults toHIDDEN. The LHN then filters it out viaisHiddenForCurrentUser.There is no mechanism to auto-join the parent public room after the anonymous-to-authenticated transition. The
SignInModalnavigates toROUTES.HOMEafter sign-in, theOnboardingGuardredirects new users to onboarding, and the user never returns to the public room context.What changes do you think we should make in order to solve the problem?
In
SignInModal, before navigating toROUTES.HOME, we should find any public room reports preserved in Onyx (via the sameisPublicRoomcheck used byshouldKeepPublicRooms) where the current authenticated user is NOT in theparticipants, and calljoinRoomfor each of them. This ensures the server adds the authenticated user as a participant with a visiblenotificationPreference, so the public room appears in the LHN after sign-in completes.The join should happen after
openAppfinishes (i.e., whenIS_LOADING_APPbecomesfalse) but before navigation to HOME, so the room is already joined by the time the LHN renders.What alternative solutions did you explore? (Optional)
Modify
shouldKeepPublicRoomsto also update theparticipantsfield — This would be a client-only optimistic fix and wouldn't actually register the user as a participant on the server. The report would still be missing from the server's response on subsequentOpenAppcalls.Navigate back to the public room after onboarding instead of HOME — This only addresses the navigation aspect but doesn't fix the
HIDDENnotification preference, so the room still wouldn't appear in the LHN sidebar.Re-fetch the parent public room report via
OpenReportafter sign-in — This would load fresh data but still wouldn't join the user to the room, so the notification preference issue would persist.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.KJ21-ENG commentedon May 13, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-05-13 16:49:46 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
After an anonymous user opens a public room, enters one of its threads, signs in as a new user, completes onboarding, and goes to Inbox, the parent public room is missing from the LHN.
What is the root cause of that problem?
In this repro the user opens the parent public room first, then enters a thread from that room. So the parent room is already in Onyx before sign-in.
SignInModalthen switches the anonymous session into a signed-in session and callsopenApp(true):App/src/pages/signin/SignInModal.tsx
Lines 39 to 48 in c5403b4
OpenApppreserves public rooms that are already inallReports, but it preserves the anonymous copy of the report:App/src/libs/actions/App.ts
Lines 380 to 390 in c5403b4
That preserved report does not have a visible
participants[currentUserAccountID].notificationPreferencefor the newly signed-in account.getReportNotificationPreference()therefore falls back toHIDDEN:App/src/libs/ReportUtils.ts
Lines 1878 to 1886 in c5403b4
and once
SignInModaldismisses and navigates Home, the public room is no longer the focused report:App/src/pages/signin/SignInModal.tsx
Lines 55 to 62 in c5403b4
so
SidebarUtils.shouldDisplayReportInLHN()drops it as hidden:App/src/libs/SidebarUtils.ts
Lines 318 to 332 in c5403b4
The missing step is not another
OpenReportread. The existing client path that turns a hidden public room into a joined/visible room isjoinRoom(), which callsupdateNotificationPreference()and writesparticipants[currentUserAccountID].notificationPreferenceoptimistically before sendingUPDATE_REPORT_NOTIFICATION_PREFERENCE:App/src/libs/actions/Report/index.ts
Lines 3320 to 3376 in c5403b4
App/src/libs/actions/Report/index.ts
Lines 4772 to 4783 in c5403b4
What changes do you think we should make in order to solve the problem?
In
SignInModal, remember the report the user was viewing when the anonymous session becomes signed in, then join that public room before navigating Home afterOpenAppfinishes.Concretely:
signInOriginReportIDRefand set it toNavigation.getTopmostReportId()in the first sign-in effect before callingopenApp(true).ONYXKEYS.COLLECTION.REPORTinSignInModal.isLoadingApp === falseeffect, derive the report to join from that origin report ID: if the origin report is a chat thread, use itsparentReportID; otherwise use the origin report itself.joinRoom(publicRoomReport, session.accountID)beforeNavigation.dismissModal()andNavigation.navigate(ROUTES.HOME).Scope boundaries:
src/pages/signin/SignInModal.tsx- imports forjoinRoomand report helpers, a sign-in-origin ref near the current refs, the current sign-in effect at lines 39-48, and the post-OpenApp navigation effect at lines 55-62.ReportFetchHandler,openReportFromDeepLink,openApppublic-room preservation, onboarding guards, generic LHN filtering, non-public reports, and unrelated public rooms that were not the sign-in origin.joinRoom->UPDATE_REPORT_NOTIFICATION_PREFERENCEpath.What alternative solutions did you explore? (Optional)
My earlier
ReportFetchHandler/parentOpenReportrefresh is not enough because it only re-reads report data. It does not write the signed-in account's visible notification preference, so the LHN can still treat the room as hidden after Home navigation.MobileMage and aswin-s point at
openReportFromDeepLinknot fetching the parent room. That would matter for a direct thread deep link, but the reported flow and video open the parent public room first, so the parent report is already present before sign-in.MelvinBot and trasnake87 use the right join mechanism, but they join every preserved public room. I would scope the auto-join to the report the user signed in from, or that report's parent when the origin is a thread, so an unrelated public room visited earlier in the anonymous session is not silently joined.
after_fix1778759439434138.mp4
melvin-bot commentedon May 13, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hungvu193 (
External)[-]Public room - Public room not display in LHN after anon user login from a thread of public room[/-][+][$250] Public room - Public room not display in LHN after anon user login from a thread of public room[/+]melvin-bot commentedon May 13, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022054600157022292037
MobileMage commentedon May 13, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When an anonymous user navigates directly to a thread inside a public room and then signs in with a new account, the parent public room does not appear in the LHN after onboarding completes, even though the thread itself was the entry point to the app.
What is the root cause of that problem?
When an anonymous user opens a deep link pointing to a thread (e.g.
/r/<threadReportID>),openReportFromDeepLinkinLink.tscallsopenReportwith only the thread'sreportID. The server'sOpenReportresponse populates Onyx with data for the thread but does not necessarily populate a standalone report entry for the parent public room underONYXKEYS.COLLECTION.REPORT<parentReportID>.When the user subsequently signs in via the sign-in button,
SignInModalcallsopenApp(true)(withshouldKeepPublicRooms = true). ThegetOnyxDataForOpenOrReconnectfunction inApp.tsscans the currentallReportsOnyx collection to find any public rooms and adds them tosuccessDataso they survive theOpenAppreport-list reset. Because the parent public room was never written toallReportsas its own entry (only the thread was opened), the scan at line 381 ofApp.tsfinds nothing to preserve. AfterOpenAppcompletes, the new user's server-side report list does not include the public room (they have not explicitly joined it), so the parent public room is absent from the LHN entirely.App/src/libs/actions/App.ts
Lines 380 to 393 in c5403b4
What changes do you think we should make in order to solve the problem?
In
openReportFromDeepLinkinsrc/libs/actions/Link.ts, after callingopenReportfor the deep-linked report, the code should check whether that report is a thread (i.e. it has aparentReportID) and, if so, also callopenReportfor theparentReportID. At the timeopenReportFromDeepLinkexecutes, the thread report may already be in thereportscollection passed as a parameter; if so, theparentReportIDcan be read directly. If the thread is not yet in the collection (it is being fetched for the first time), the code should subscribe to the Onyx key for the thread report and, once it arrives with aparentReportID, callopenReporton that parent. This ensures the parent public room is written intoallReportsbeforeopenApp(true)fires inSignInModal, so theshouldKeepPublicRoomspreservation logic at line 381 ofApp.tscan find it and add it tosuccessData.Concretely, after the
openReport({reportID, ...})call at line 245 ofLink.ts, add logic that readsreports?.[ONYXKEYS.COLLECTION.REPORT + reportID]?.parentReportIDand, if present (meaning the report is a thread with a known parent), callsopenReport({reportID: parentReportID, isFromDeepLink: false, ...}). If the parent is not yet available, useOnyx.connectWithoutViewon the thread report key and trigger the parentopenReportcall as soon as the thread data arrives with aparentReportID, disconnecting immediately after. This mirrors the existing pattern used elsewhere inLink.ts(lines 351–360) to wait for report data before acting.App/src/libs/actions/Link.ts
Lines 225 to 255 in c5403b4
What alternative solutions did you explore? (Optional)
An alternative would be to extend the
shouldKeepPublicRoomslogic ingetOnyxDataForOpenOrReconnectto also walk theparentReportIDchain of any reports currently inallReportsand preserve those ancestor reports if they are public rooms. This would catch the case without modifying the deep-link flow, but it adds complexity to a function that runs on everyOpenAppandReconnectAppcall, whereas fixing the deep-link entry point is more targeted and correct by design. Another option would be to have the server return the parent report as part of theOpenReportresponse for threads — but that is a backend change outside the scope of this issue.aswin-s commentedon May 13, 2026
Please re-state the problem that we are trying to solve in this issue.
When an anonymous user opens a deep link to a thread inside a public room (e.g.,
/r/<threadID>), signs in as a new user, and completes onboarding, the public room does not appear in the LHN. The user expects the public room to be visible alongside other accessible rooms after sign-in, but instead only their joined rooms are shown because the parent public room was never written to Onyx during the anonymous deep-link flow.What is the root cause of that problem?
In
src/libs/actions/Link.ts:244–246, whenopenReportFromDeepLinkis called with a thread reportID, it only callsopenReportfor that thread. The server returns thread data, but the parent public room is never fetched or stored inallReportsas a standalone entry. Later, whenSignInModalcallsopenApp(true)(src/pages/signin/SignInModal.tsx:48),getOnyxDataForOpenOrReconnectinApp.ts:380filters allReports for public rooms:Since the thread is not itself a public room and the parent public room is absent from Onyx, this filter matches nothing. After
openAppresets the report collection, the newly signed-in user's server-supplied report list also lacks the public room (the user has not joined it), so it never appears in the LHN.App/src/libs/actions/Link.ts
Lines 244 to 246 in c5403b4
App/src/pages/signin/SignInModal.tsx
Line 48 in c5403b4
What changes do you think we should make in order to solve the problem?
File:
src/libs/actions/Link.tsFunction:
openReportFromDeepLinkDescription: After the initial
openReport({reportID, ...})call for the thread, fetch the parent public room using the following logic:ONYXKEYS.COLLECTION.REPORT + reportID) usingOnyx.connect. Store the connection ID so it can be disconnected after use, preventing memory leaks and infinite loops.report?.parentReportIDis a non-empty string before proceeding. IfparentReportIDis absent or falsy, disconnect and return early — this guards against threads that have no parent or whose parent field has not yet been hydrated.parentReportIDis confirmed, disconnect the Onyx listener immediately (callOnyx.disconnect(connectionID)) before firing any further action, ensuring the listener fires at most once and cannot loop.openReport({reportID: report.parentReportID, isFromDeepLink: true, ...})to fetch and cache the parent public room. This ensures the parent public room is written toallReportsbeforeSignInModaltriggersopenApp(true), allowinggetOnyxDataForOpenOrReconnectto find and preserve it.Sketch of the addition (immediately after the existing
openReportcall for the thread):This pattern is safe across both web and mobile:
Onyx.connectis the same cross-platform primitive used throughout the codebase for one-time data reads, and disconnecting in the callback before dispatching the side-effect is the standard idiom for avoiding re-entrancy. There is no platform-specific Onyx behavior in this path that requires separate handling.What alternative solutions did you explore? (Optional)
N/A
aswin-s commentedon May 13, 2026
Updated the proposal above to tighten 4 edge cases (additional guards and broader coverage).
trasnake87 commentedon May 13, 2026
Proposal
When an anonymous viewer of a public room signs in (or signs up) from within a thread of that room, the public room remains in Onyx but never appears in the LHN of the newly authenticated session.
Root cause
Two pieces of logic combine to produce the bug.
1 - Public room is preserved in Onyx, but the new account is not a participant
SignInModaltriggersopenApp(true)once the session transitions out ofANONYMOUS, so the public room is intentionally re-merged into Onyx as part of OpenApp'ssuccessData—src/pages/signin/SignInModal.tsx:39-49:The merge happens in
src/libs/actions/App.ts:377-390:The report object that is re-merged is the one that was fetched while the viewer was anonymous: its
participantsmap does not contain the freshly created account'saccountID. OpenApp's normal response only carries reports the new account is actually a member of, and a public room visited as an anonymous user is not one of them — so nothing in the response writes a participant entry for the new account either.2 - Missing participant entry collapses notificationPreference to
HIDDEN, which LHN filters outgetReportNotificationPreferencereads the preference off the current user's slot inreport.participants—src/libs/ReportUtils.ts:1888-1897:With no entry for the new
accountID, this returnsHIDDEN.isHiddenForCurrentUser(src/libs/ReportUtils.ts:2223-2234) then returnstrue, andSidebarUtils.getOptionDatadrops the report atsrc/libs/SidebarUtils.ts:303/:331-333because none of theshouldOverrideHiddenconditions (draftComment, focused, pinned, system chat,requiresAttention, errors, own policy expense chat) apply to a public room the user has just been signed-in to:Net effect: the room sits in Onyx with no
participants[newAccountID], the LHN treats it as hidden, and the user only sees an empty Inbox after onboarding even though they explicitly chose to sign in from inside that room.Proposed fix
After
openAppfinishes (i.e., onceIS_LOADING_APPflips back tofalse), iterate over the public rooms thatshouldKeepPublicRoomsjust preserved and calljoinRoomfor any where the newly authenticatedaccountIDis not already a participant.joinRoomalready wrapsupdateNotificationPreference, which short-circuits whenpreviousValue === newValue(src/libs/actions/Report/index.ts:3078-3081), so it is a no-op for rooms the user is already a member of.Update
src/pages/signin/SignInModal.tsxso the seconduseEffectjoins any preserved public rooms before dismissing the modal:The participant guard (
report?.participants?.[currentUserAccountID]) keeps the call tojoinRoomcheap and avoids redundantUpdateReportNotificationPreferencewrites for users who happened to revisit the same room from a non-anonymous session.joinRoomitself resolves the correct preference for the room type viagetDefaultNotificationPreferenceForReport(DAILYfor public rooms,ALWAYSfor public-announce —src/libs/ReportUtils.ts:1869-1886), so bothVISIBILITY.PUBLICandVISIBILITY.PUBLIC_ANNOUNCEare handled correctly. The optimistic data inupdateNotificationPreference(src/libs/actions/Report/index.ts:3083-3095) immediately writesparticipants[currentUserAccountID].notificationPreference = DAILY, which un-hides the room in the LHN on the very next render — i.e., before the user even taps the Inbox tab.Why this approach
Doing the join on the client mirrors what already happens elsewhere in the app when a logged-in user enters a public room and presses the "Join" promoted action (
src/components/PromotedActionsBar.tsx:65-73andsrc/pages/inbox/HeaderView.tsx:198) — we reuse the samejoinRoom→updateNotificationPreference→UPDATE_REPORT_NOTIFICATION_PREFERENCEpath that the server already understands, so the user becomes a real participant on the backend rather than only locally. Two alternatives were considered and rejected: (a) injecting a participant entry directly into thesuccessDataofopenAppinApp.ts:377-390would un-hide the room only locally and would be wiped by the next ReconnectApp because the backend wouldn't know the user joined; (b) auto-navigating back to the originating public room URL instead ofROUTES.HOMEwould conflict withOnboardingGuard's redirect for new accounts and would not handle the case where the anonymous session had visited multiple public rooms. Gating the call onisLoadingApp === falseensures theshouldKeepPublicRoomsmerge in OpenApp'ssuccessDatahas already run, so we are joining the same set of rooms that were preserved rather than racing against the queue.44 remaining items
melvin-bot commentedon Jun 11, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jun 11, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Jun 15, 2026
Payment Summary
Contributor: @nkdengineer due $250 via NewDot
Contributor+: @hungvu193 due $250 via NewDot
^ Test case created. Thx
twisterdotcom commentedon Jun 16, 2026
$250 approved for @nkdengineer in Report ID: R009bfMTMRr7.
Zapier Logs
Run ID: 00040eee-d00a-af26-bab0-c4006ae37934SO: https://stackoverflowteams.com/c/expensify/questions/7582
JmillsExpensify commentedon Jun 16, 2026
$250 approved for @hungvu193