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-07-29] [$250] Anon user can't reach public room #92672
Version Number: v9.3.99-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#91931 Email or phone of affected tester (no customers): - Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Xiaomi RedMi Note 10 / Android 12 App Component: Other
Confidence: Medium — the failing LHN filter chain is identified with code evidence, but the precise trigger (thread data missing vs. parent lookup failing) needs one runtime Onyx check to confirm. Details below.
What is the root cause of that problem?
When an anonymous user opens a thread inside a public room, the LHN goes empty because the sidebar's filter drops both reports it could show:
The thread itself is only kept if it's present in Onyx. The sidebar iterates the report_* Onyx collection, and a report is force-kept only when report.reportID === currentReportId (ReportUtils.ts:9579-9581). For an anonymous user the freshly-opened thread report often isn't (yet) populated in Onyx, so it is never iterated and never added.
The parent public room is then removed by the empty-chat filter (ReportUtils.ts:9711-9723). That filter keeps the room only when canHideReport is false, and canHideReport comes from shouldHideReport, which keeps the room only if it is the parent of the currently-viewed report: parentReport?.reportID !== report?.reportID. That check relies on getParentReport(currentReport) resolving the room — which fails when the focused thread isn't in Onyx (getParentReport(undefined) → undefined), so the room is hidden too.
Net result: 0 items in the list → SidebarLinks.tsx:88 renders the "Woohoo! All caught up." empty state.
This is not caused by the recently merged #91931 (fix for #90536). That PR's new code only runs on the anon→signed-in transition or writes an Onyx key read nowhere in the LHN path. In fact it's the same broken intermediate state — an anon user sitting on a public-room thread with no public room in the LHN — that #91931's joinPublicRoomIfNeeded band-aids after sign-in. QA caught the before-sign-in version of it, which is this issue.
One runtime check to confirm root cause (anon session, inspect Onyx at the empty-LHN moment): is report_<threadID> present and does it carry parentReportID? If absent, the trigger is "thread not loaded for anon users" (the openReport(threadID) response is the thing to verify) rather than a pure filter bug. This distinction decides whether the real fix is client-side (keep the parent room visible) or backend (return thread data to anon users).
What changes do you think we should make in order to solve the problem?
Keep the parent public room visible in the LHN while an anonymous user is viewing one of its threads, instead of depending on the thread being fully loaded in Onyx. Practically, make shouldHideReport resilient when the currently-viewed report is a thread of a public room — the public room should not be hidden just because getParentReport(currentReport) momentarily returns undefined. Confirm with the runtime Onyx check above first; if it shows the thread report never loads for anon users at all, the fix belongs in the openReport / data-loading path (and may require a backend change to return thread data for anonymous users — which would be outside this repo).
What alternative solutions did you explore? (Optional)
Have ReportFetchHandler track the parent room when an anon user opens a thread by handling the thread case in ReportFetchHandler.tsx:272-278 (it currently bails on isPublicRoom(thread) === false). This fixes the related post-sign-in flow but does not by itself repopulate the live LHN, so it's complementary rather than a full fix.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/92672) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Please re-state the problem that we are trying to solve in this issue.
When an anonymous (logged-out) user opens a public room via a deep link and then opens a thread inside it, the public room is expected to appear in the Inbox (LHN). Instead the Inbox shows the empty "Woohoo! All caught up" state and the public room is missing (reproduced on Android).
What is the root cause of that problem?
Before a report reaches the option-list check, the LHN drops it if it is hidden for the current user and nothing overrides that. The override list (shouldOverrideHidden) only covers drafts, errors, the focused report, system chat, pinned, attention, and own policy expense chat — there is no exemption for public rooms.
An anonymous user is not a participant of the public room, so the report has no notification preference for them. isHiddenForCurrentUser returns true whenever the preference is undefined/null/'', so the public room is treated as hidden. Combined with the missing override, the room is filtered out of the LHN once it is not the focused report (e.g. after opening a thread), producing the empty Inbox.
What changes do you think we should make in order to solve the problem?
Exempt public rooms viewed by an anonymous user from the hidden filter, so they remain visible in the LHN even without a notification preference. This adds one condition to shouldOverrideHidden (importing isPublicRoom from ./ReportUtils and isAnonymousUser from ./actions/Session).
What alternative solutions did you explore? (Optional)
Exempt public rooms regardless of session type by adding || isPublicRoom(report) to shouldOverrideHidden. This is simpler and avoids the isAnonymousUser dependency, but it widens the change to logged-in users as well, so a public room a signed-in user has hidden would also resurface in the LHN — broader than the reported scenario and riskier.
Please re-state the problem that we are trying to solve in this issue.
An anonymous (logged-out) user opens a public room via a deep link, then taps into the Inbox. Instead of seeing the public room they're viewing, the Inbox shows the "Woohoo! All caught up." empty state. The same thing happens after drilling into a thread of that room — the public room disappears from the LHN entirely, so the user has no way back to it from the Inbox.
What is the root cause of that problem?
An anonymous user is never a participant of the public room they land on, so the room's notification preference is HIDDEN. That single fact is what makes it drop out of the LHN.
The LHN inclusion logic in SidebarUtils.shouldDisplayReportInLHN computes isHidden from the notification preference and then bails unless an explicit override applies:
For an anonymous viewer of a public room, the only override that ever fires is isFocused (report.reportID === currentReportId). The same IS_FOCUSED carve-out is the first thing checked in reasonForReportToBeInOptionList:
So the room is visible only while it is the open report. The moment the anonymous user navigates to the Inbox (narrow layout — Android app — means no report is focused) or opens a thread (now the thread is focused, not the room), isFocused is false for the room, none of the other overrides apply, isHidden wins, and the room is filtered out. With nothing else in an anonymous session's LHN, the list collapses to "All caught up." A signed-in user never hits this because opening/joining the room sets a non-hidden notification preference.
This is also why it surfaced during QA of #91931: that PR fixed the post-login variant by recording the room the anonymous user is on in VIEWING_PUBLIC_ROOM_REPORT_ID and re-opening it after sign-in. But the still-anonymous path was never wired into the LHN — the tracked report ID isn't consulted when deciding what to show, so the room is hidden as soon as it loses focus.
What changes do you think we should make in order to solve the problem?
Reuse the VIEWING_PUBLIC_ROOM_REPORT_ID that #91931 already maintains, and treat "the public room this anonymous user is currently viewing" the same way the code treats the focused report — keep it in the LHN even when something else is focused. That key is only ever written for anonymous users (the effect that sets it is gated on isAnonymousUser), so matching against it is inherently anon-scoped and won't affect signed-in users.
The room has to clear both gates, so the change is in two spots. First, the hidden override in shouldDisplayReportInLHN:
Second, mirror the IS_FOCUSED short-circuit in reasonForReportToBeInOptionList so the room isn't dropped later by the excludeEmptyChats / canHideReport checks:
if (report?.reportID === currentReportId) {
return CONST.REPORT_IN_LHN_REASONS.IS_FOCUSED;
}
+ // Keep the public room an anonymous user is currently viewing in the LHN even after+ // they open one of its threads or navigate to the Inbox (where nothing is focused).+ if (!!viewingPublicRoomReportID && report?.reportID === viewingPublicRoomReportID) {+ return CONST.REPORT_IN_LHN_REASONS.DEFAULT;+ }
The supporting plumbing is mechanical: thread viewingPublicRoomReportID through ShouldDisplayReportInLHNParams and ShouldReportBeInOptionListParams, forward it from getReportsToDisplayInLHN / updateReportsToDisplayInLHN, and read it once in useSidebarOrderedReports via useOnyx(ONYXKEYS.VIEWING_PUBLIC_ROOM_REPORT_ID) before passing it into both SidebarUtils calls.
One thing to watch: #91931 sets VIEWING_PUBLIC_ROOM_REPORT_ID but never clears it. With this change the tracked room now stays pinned in the LHN, so it should be reset when it's no longer relevant — clear it on sign-in completion and when the anonymous ReportFetchHandler unmounts — otherwise a stale public room could linger after the user moves on. Scope boundary: the override only matches a report whose ID equals an anon-only Onyx value, so signed-in LHNs, search results, and every other report are untouched. Test: as an anonymous user, open a public room deep link, then open the Inbox → the room is listed (not "All caught up"); open one of its threads, return to the Inbox → the room is still listed.
What alternative solutions did you explore? (Optional)
Setting a non-hidden notification preference on the room when an anonymous user opens it, so it survives the isHidden gate the normal way. Rejected: notification preference is a participant-level setting synced to the back end, and an anonymous viewer isn't a member — writing one fakes membership state, risks being pushed to the server, and would have to be torn down on sign-in. Gating LHN visibility on the existing "currently viewing" signal is local, reversible, and already half-built by #91931. I also considered widening the isFocused definition itself to include the parent room while a thread is focused, but isFocused is used well beyond the hidden override (highlighting, sorting, the option-list reason), and overloading it would leak "this room is selected" semantics into places that genuinely mean the active report.
Please re-state the problem that we are trying to solve in this issue.
When an anonymous user opens a public room and then taps into a thread inside that room, the public room disappears from the Inbox/LHN and the "Woohoo! All caught up" empty state is shown, so the anon user can no longer get back to the public room.
What is the root cause of that problem?
The LHN filters every report through shouldDisplayReportInLHN in SidebarUtils. For a report whose notification preference is hidden, that function only keeps it in the list when one of the shouldOverrideHidden conditions is true — and the only relevant one here is isFocused (i.e. the report is the one currently being viewed):
So the room only survives the LHN filter while it is the focused report (reasonForReportToBeInOptionList short-circuits to IS_FOCUSED for report.reportID === currentReportId):
The moment the anon user opens a thread inside the room, currentReportId becomes the thread, the public room is no longer focused, isHidden && !shouldOverrideHidden is now true, and shouldDisplayReportInLHN returns {shouldDisplay: false} — dropping the room from the Inbox. The thread itself is also hidden for the same reason once it loses focus, which is why the Inbox collapses all the way to "All caught up".
Note this is not fixed by #91931 (the PR this was caught under). That PR stores VIEWING_PUBLIC_ROOM_REPORT_ID and re-openReports the room, but only after sign-in — its effect is gated on the anonymous → signed-in transition (ReportFetchHandler L272-L278). While the user stays anonymous, nothing keeps the room in the LHN.
What changes do you think we should make in order to solve the problem?
An anonymous session can only ever access public rooms, so a public room should not be hidden from an anon user's LHN just because it isn't the focused report. I'd add that as an override in shouldDisplayReportInLHN:
const shouldOverrideHidden =
!!draftComment ||
hasErrorsOtherThanFailedReceipt ||
isFocused ||
+ // An anonymous user can only access public rooms, and such a room's notification preference+ // defaults to `hidden`. Without this, opening a thread inside the room (which steals focus)+ // drops the room from the LHN, leaving the anon user unable to return to it. See #92672.+ (isPublicRoom(report) && isAnonymousUser()) ||
isSystemChat ||
!!report.isPinned ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
requiresAttention ||
(report.isOwnPolicyExpenseChat && !isReportArchived);
Supporting change: import isPublicRoom from ./ReportUtils and isAnonymousUser from ./actions/Session in SidebarUtils.ts.
This pairs isPublicRoom with isAnonymousUser() exactly the way ReportUtils already gates anon-only public-room behaviour elsewhere, e.g. in canLeaveChat:
Once this override is in place, the non-focused public room still passes the rest of reasonForReportToBeInOptionList (it has a reportName/type, is a chat room, is accessible to anon, and already has its CREATED + message actions loaded, so it isn't excluded as empty), so it renders normally in the Inbox.
Edge cases:
Offline: purely a client-side display predicate, so it works the same offline.
Platforms: the LHN filter is shared, so the fix covers all platforms (the report is from Android App, but the same path runs everywhere a thread can steal focus from the room).
What alternative solutions did you explore? (Optional)
Plumb VIEWING_PUBLIC_ROOM_REPORT_ID (from Public room not display in LHN after anon user login from a thread of public room #91931) into SidebarUtils and override hidden only for that exact room. Rejected: it threads an Onyx value through getReportsToDisplayInLHN → updateReportsToDisplayInLHN → shouldDisplayReportInLHN for no real gain — in an anon session the only rooms in Onyx are public rooms anyway, so the broader isPublicRoom && isAnonymousUser check is simpler and just as safe.
Give the anon user's public room a non-hidden notification preference. Rejected: that mutates report/Onyx data and would ripple into unread/GBR, leave-room and other notification-driven logic — far more side effects than a display-only fix.
Treat the parent public room as "focused" whenever the current report is its thread. Rejected: currentReportId is a single value consumed across the whole option-list pipeline; overloading it is regression-prone compared to a targeted override.
This is Android native specific. In the Android app, after an anonymous user opens a public room from /r/1540486774487195, then taps Inbox, the active route becomes the Inbox/sidebar route instead of the report route. That makes the route-derived currentReportID stop pointing at the public room.
But that remembered public-room ID is only used for the anonymous-to-signed-in refetch case. The LHN/sidebar still derives its active report only from navigation state:
// Include the currently viewed report. If we excluded the currently viewed report, then there
// would be no way to highlight it in the options list and it would be confusing to users because they lose
// a sense of context.
if(report?.reportID===currentReportId){
returnCONST.REPORT_IN_LHN_REASONS.IS_FOCUSED;
So on Android native, tapping Inbox makes the public room no longer look “focused” to the LHN, even though VIEWING_PUBLIC_ROOM_REPORT_ID still knows which anonymous public room should stay visible. Since this anonymous public room can otherwise look like an empty/non-joined room, it gets filtered out and the Inbox shows the empty “Woohoo! All caught up.” state.
What changes do you think we should make in order to solve the problem?
In useSidebarOrderedReports, use VIEWING_PUBLIC_ROOM_REPORT_ID as the effective current report only for anonymous users.
Also include isAnonymousUser and viewingPublicRoomReportID in the relevant memo/callback dependency lists.
This keeps the fix scoped to anonymous public-room browsing. Authenticated users and normal Inbox behavior continue using the route-derived current report.
Add a regression test in tests/unit/useSidebarOrderedReportsTest.tsx:
Open https://staging.new.expensify.com/r/1540486774487195.
Open Inbox.
Verify the public room is shown in Inbox instead of “Woohoo! All caught up.”
What alternative solutions did you explore? (Optional)
We could make all public rooms bypass the LHN filters, but that is too broad and could show unrelated public rooms. Using VIEWING_PUBLIC_ROOM_REPORT_ID is narrower because it only preserves the anonymous public room the user actually opened.
The new effect added by PR #91931 is supposed to remember the public room an anonymous user is viewing (or whose thread they are viewing) in VIEWING_PUBLIC_ROOM_REPORT_ID, but its guard never lets the thread case through.
So whenever an anonymous user is viewing a thread of a public room, isPublicRoom(report) is false, the effect bails out, and the isThread(report) ? report.parentReportID : reportID branch the author wrote is dead code. The Onyx key only ever gets set when the route happens to be the public room itself; the moment the anonymous user steps into a thread the public room context is no longer being tracked.
That is exactly the QA flow:
Anon lands on /r/1540486774487195 (the public room) → effect runs with the public room as report, VIEWING_PUBLIC_ROOM_REPORT_ID is set ✓
This is also why the same QA scenario didn't reproduce in the PR's original test plan: the PR demo started on the public room first, which let step 1 prime the Onyx key. Land on a thread URL directly (or do any state transition that re-runs this effect while on a thread) and the tracking is silently lost.
What changes do you think we should make in order to solve the problem?
I'd subscribe to the parent report and treat "thread of a public room" as a public-room context for the purposes of this effect. The ternary already encodes the intent — we just need to let that branch run.
Subscribe to parentReport via parentReportID (mirroring how chatReport is already subscribed in this file).
Compute isThreadOfPublicRoom from isThread(report) && isPublicRoom(parentReport) so we use the parent's visibility, not the (always-empty) thread visibility.
Allow the effect to write when either the report itself is a public room, or it's a thread of one — keeping the existing ternary behavior (parent ID for the thread case, reportID otherwise).
I'd also add a regression test that mounts ReportFetchHandler with an anonymous session and a thread whose parentReportID points at a public room, and asserts VIEWING_PUBLIC_ROOM_REPORT_ID ends up equal to the parent's reportID.
What alternative solutions did you explore? (Optional)
Teach isPublicRoom itself to walk the parent chain (e.g. isPublicRoom(report) || (isThread(report) && parent?.visibility === PUBLIC...)). Strongest competing fix: it removes the bug everywhere isPublicRoom is used today, including unrelated call sites like ReportFooter.tsx#L75 and canLeaveChat in ReportUtils.ts#L11280. Rejected because those existing call sites intentionally distinguish "the room itself" from "a thread inside it" — ReportFooter's anonymous-composer optimistic state and canLeaveChat's "anon can't leave a public room" guard would silently change meaning. Containing the parent-aware check inside the single effect that actually needs it keeps blast radius zero.
Call joinPublicRoomIfNeeded/openReport(publicRoomID) directly from the thread-open path instead of relying on the Onyx key, eagerly re-hydrating the public room whenever an anonymous user lands on a thread. Rejected because it duplicates fetching with the existing fetchReport() flow and would refetch the public room on every focus change rather than only on the sign-in transition; it also wouldn't fix the dead isThread(report) ? report.parentReportID : reportID branch, which is a real bug regardless.
Set VIEWING_PUBLIC_ROOM_REPORT_ID from the link-handling layer (e.g. when Link.openLink resolves a public-room report ID for an anonymous user) so the Onyx key is primed without depending on a React effect at all. Rejected because the focused-screen effect is the cheapest source of truth for "which public room is this anon session looking at right now" — moving it upstream means re-implementing focus tracking and dealing with route changes that don't go through Link.openLink (e.g. in-app Navigation.navigate from a parent room into a child thread).
@yusufdeveloper2903 can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal. https://www.upwork.com/jobs/~022082920102476221973
Activity
applause-bot commentedon Jun 4, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/5a47c57779cedad9db830ec8ab628ec2a05004cd9298d0e571bc8ac714d20206
MelvinBot commentedon Jun 4, 2026
Proposal
What is the root cause of that problem?
When an anonymous user opens a thread inside a public room, the LHN goes empty because the sidebar's filter drops both reports it could show:
The thread itself is only kept if it's present in Onyx. The sidebar iterates the
report_*Onyx collection, and a report is force-kept only whenreport.reportID === currentReportId(ReportUtils.ts:9579-9581). For an anonymous user the freshly-opened thread report often isn't (yet) populated in Onyx, so it is never iterated and never added.The parent public room is then removed by the empty-chat filter (
ReportUtils.ts:9711-9723). That filter keeps the room only whencanHideReportis false, andcanHideReportcomes fromshouldHideReport, which keeps the room only if it is the parent of the currently-viewed report:parentReport?.reportID !== report?.reportID. That check relies ongetParentReport(currentReport)resolving the room — which fails when the focused thread isn't in Onyx (getParentReport(undefined) → undefined), so the room is hidden too.Net result: 0 items in the list →
SidebarLinks.tsx:88renders the "Woohoo! All caught up." empty state.This is not caused by the recently merged #91931 (fix for #90536). That PR's new code only runs on the anon→signed-in transition or writes an Onyx key read nowhere in the LHN path. In fact it's the same broken intermediate state — an anon user sitting on a public-room thread with no public room in the LHN — that #91931's
joinPublicRoomIfNeededband-aids after sign-in. QA caught the before-sign-in version of it, which is this issue.Evidence chain (file:line)
SidebarLinksData.tsx→useSidebarOrderedReports.tsx→SidebarUtils.getReportsToDisplayInLHN→shouldReportBeInOptionList→reasonForReportToBeInOptionList.ReportUtils.ts:9579-9581— only saves a report that is actually in the Onyx collection.canHideReport:ReportUtils.ts:9711-9723.shouldHideReportdepends ongetParentReport(currentReport):ReportUtils.ts:9121-9138.isPublicRoom(report), which is false for a thread (threads don't inheritvisibility), so it no-ops when an anon user goes room → thread:ReportFetchHandler.tsx:272-278.One runtime check to confirm root cause (anon session, inspect Onyx at the empty-LHN moment): is
report_<threadID>present and does it carryparentReportID? If absent, the trigger is "thread not loaded for anon users" (theopenReport(threadID)response is the thing to verify) rather than a pure filter bug. This distinction decides whether the real fix is client-side (keep the parent room visible) or backend (return thread data to anon users).What changes do you think we should make in order to solve the problem?
Keep the parent public room visible in the LHN while an anonymous user is viewing one of its threads, instead of depending on the thread being fully loaded in Onyx. Practically, make
shouldHideReportresilient when the currently-viewed report is a thread of a public room — the public room should not be hidden just becausegetParentReport(currentReport)momentarily returnsundefined. Confirm with the runtime Onyx check above first; if it shows the thread report never loads for anon users at all, the fix belongs in theopenReport/ data-loading path (and may require a backend change to return thread data for anonymous users — which would be outside this repo).What alternative solutions did you explore? (Optional)
Have
ReportFetchHandlertrack the parent room when an anon user opens a thread by handling the thread case inReportFetchHandler.tsx:272-278(it currently bails onisPublicRoom(thread) === false). This fixes the related post-sign-in flow but does not by itself repopulate the live LHN, so it's complementary rather than a full fix.Related issues
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/92672)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
abbasifaizan70 commentedon Jun 4, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When an anonymous (logged-out) user opens a public room via a deep link and then opens a thread inside it, the public room is expected to appear in the Inbox (LHN). Instead the Inbox shows the empty "Woohoo! All caught up" state and the public room is missing (reproduced on Android).
What is the root cause of that problem?
Before a report reaches the option-list check, the LHN drops it if it is hidden for the current user and nothing overrides that. The override list (
shouldOverrideHidden) only covers drafts, errors, the focused report, system chat, pinned, attention, and own policy expense chat — there is no exemption for public rooms.App/src/libs/SidebarUtils.ts
Lines 323 to 338 in 21afc57
An anonymous user is not a participant of the public room, so the report has no notification preference for them.
isHiddenForCurrentUserreturnstruewhenever the preference isundefined/null/'', so the public room is treated as hidden. Combined with the missing override, the room is filtered out of the LHN once it is not the focused report (e.g. after opening a thread), producing the empty Inbox.App/src/libs/ReportUtils.ts
Lines 2241 to 2250 in 21afc57
What changes do you think we should make in order to solve the problem?
Exempt public rooms viewed by an anonymous user from the hidden filter, so they remain visible in the LHN even without a notification preference. This adds one condition to
shouldOverrideHidden(importingisPublicRoomfrom./ReportUtilsandisAnonymousUserfrom./actions/Session).App/src/libs/SidebarUtils.ts
Lines 326 to 334 in 21afc57
What alternative solutions did you explore? (Optional)
Exempt public rooms regardless of session type by adding
|| isPublicRoom(report)toshouldOverrideHidden. This is simpler and avoids theisAnonymousUserdependency, but it widens the change to logged-in users as well, so a public room a signed-in user has hidden would also resurface in the LHN — broader than the reported scenario and riskier.App/src/libs/SidebarUtils.ts
Lines 326 to 334 in 21afc57
kamronbek04 commentedon Jun 4, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
An anonymous (logged-out) user opens a public room via a deep link, then taps into the Inbox. Instead of seeing the public room they're viewing, the Inbox shows the "Woohoo! All caught up." empty state. The same thing happens after drilling into a thread of that room — the public room disappears from the LHN entirely, so the user has no way back to it from the Inbox.
What is the root cause of that problem?
An anonymous user is never a participant of the public room they land on, so the room's notification preference is
HIDDEN. That single fact is what makes it drop out of the LHN.The LHN inclusion logic in
SidebarUtils.shouldDisplayReportInLHNcomputesisHiddenfrom the notification preference and then bails unless an explicit override applies:https://github.com/Expensify/App/blob/main/src/libs/SidebarUtils.ts#L318-L333
For an anonymous viewer of a public room, the only override that ever fires is
isFocused(report.reportID === currentReportId). The sameIS_FOCUSEDcarve-out is the first thing checked inreasonForReportToBeInOptionList:https://github.com/Expensify/App/blob/main/src/libs/ReportUtils.ts#L9514-L9519
So the room is visible only while it is the open report. The moment the anonymous user navigates to the Inbox (narrow layout — Android app — means no report is focused) or opens a thread (now the thread is focused, not the room),
isFocusedis false for the room, none of the other overrides apply,isHiddenwins, and the room is filtered out. With nothing else in an anonymous session's LHN, the list collapses to "All caught up." A signed-in user never hits this because opening/joining the room sets a non-hidden notification preference.This is also why it surfaced during QA of #91931: that PR fixed the post-login variant by recording the room the anonymous user is on in
VIEWING_PUBLIC_ROOM_REPORT_IDand re-opening it after sign-in. But the still-anonymous path was never wired into the LHN — the tracked report ID isn't consulted when deciding what to show, so the room is hidden as soon as it loses focus.What changes do you think we should make in order to solve the problem?
Reuse the
VIEWING_PUBLIC_ROOM_REPORT_IDthat #91931 already maintains, and treat "the public room this anonymous user is currently viewing" the same way the code treats the focused report — keep it in the LHN even when something else is focused. That key is only ever written for anonymous users (the effect that sets it is gated onisAnonymousUser), so matching against it is inherently anon-scoped and won't affect signed-in users.The room has to clear both gates, so the change is in two spots. First, the hidden override in
shouldDisplayReportInLHN:const shouldOverrideHidden = !!draftComment || hasErrorsOtherThanFailedReceipt || isFocused || + report.reportID === viewingPublicRoomReportID || isSystemChat || !!report.isPinned || // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing requiresAttention || (report.isOwnPolicyExpenseChat && !isReportArchived);Second, mirror the
IS_FOCUSEDshort-circuit inreasonForReportToBeInOptionListso the room isn't dropped later by theexcludeEmptyChats/canHideReportchecks:if (report?.reportID === currentReportId) { return CONST.REPORT_IN_LHN_REASONS.IS_FOCUSED; } + // Keep the public room an anonymous user is currently viewing in the LHN even after + // they open one of its threads or navigate to the Inbox (where nothing is focused). + if (!!viewingPublicRoomReportID && report?.reportID === viewingPublicRoomReportID) { + return CONST.REPORT_IN_LHN_REASONS.DEFAULT; + }The supporting plumbing is mechanical: thread
viewingPublicRoomReportIDthroughShouldDisplayReportInLHNParamsandShouldReportBeInOptionListParams, forward it fromgetReportsToDisplayInLHN/updateReportsToDisplayInLHN, and read it once inuseSidebarOrderedReportsviauseOnyx(ONYXKEYS.VIEWING_PUBLIC_ROOM_REPORT_ID)before passing it into bothSidebarUtilscalls.One thing to watch: #91931 sets
VIEWING_PUBLIC_ROOM_REPORT_IDbut never clears it. With this change the tracked room now stays pinned in the LHN, so it should be reset when it's no longer relevant — clear it on sign-in completion and when the anonymousReportFetchHandlerunmounts — otherwise a stale public room could linger after the user moves on. Scope boundary: the override only matches a report whose ID equals an anon-only Onyx value, so signed-in LHNs, search results, and every other report are untouched. Test: as an anonymous user, open a public room deep link, then open the Inbox → the room is listed (not "All caught up"); open one of its threads, return to the Inbox → the room is still listed.What alternative solutions did you explore? (Optional)
Setting a non-hidden notification preference on the room when an anonymous user opens it, so it survives the
isHiddengate the normal way. Rejected: notification preference is a participant-level setting synced to the back end, and an anonymous viewer isn't a member — writing one fakes membership state, risks being pushed to the server, and would have to be torn down on sign-in. Gating LHN visibility on the existing "currently viewing" signal is local, reversible, and already half-built by #91931. I also considered widening theisFocuseddefinition itself to include the parent room while a thread is focused, butisFocusedis used well beyond the hidden override (highlighting, sorting, the option-list reason), and overloading it would leak "this room is selected" semantics into places that genuinely mean the active report.yusufdeveloper2903 commentedon Jun 4, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When an anonymous user opens a public room and then taps into a thread inside that room, the public room disappears from the Inbox/LHN and the "Woohoo! All caught up" empty state is shown, so the anon user can no longer get back to the public room.
What is the root cause of that problem?
The LHN filters every report through
shouldDisplayReportInLHNinSidebarUtils. For a report whose notification preference ishidden, that function only keeps it in the list when one of theshouldOverrideHiddenconditions is true — and the only relevant one here isisFocused(i.e. the report is the one currently being viewed):App/src/libs/SidebarUtils.ts
Lines 327 to 339 in 753ada2
For an anonymous user, a public room is always hidden. The user isn't a real participant, so
getReportNotificationPreferencefalls back toHIDDEN:App/src/libs/ReportUtils.ts
Lines 1897 to 1903 in 753ada2
and
isHiddenForCurrentUsertherefore returnstrue:App/src/libs/ReportUtils.ts
Lines 2241 to 2250 in 753ada2
So the room only survives the LHN filter while it is the focused report (
reasonForReportToBeInOptionListshort-circuits toIS_FOCUSEDforreport.reportID === currentReportId):App/src/libs/ReportUtils.ts
Lines 9579 to 9581 in 753ada2
The moment the anon user opens a thread inside the room,
currentReportIdbecomes the thread, the public room is no longer focused,isHidden && !shouldOverrideHiddenis nowtrue, andshouldDisplayReportInLHNreturns{shouldDisplay: false}— dropping the room from the Inbox. The thread itself is also hidden for the same reason once it loses focus, which is why the Inbox collapses all the way to "All caught up".Note this is not fixed by #91931 (the PR this was caught under). That PR stores
VIEWING_PUBLIC_ROOM_REPORT_IDand re-openReports the room, but only after sign-in — its effect is gated on the anonymous → signed-in transition (ReportFetchHandler L272-L278). While the user stays anonymous, nothing keeps the room in the LHN.What changes do you think we should make in order to solve the problem?
An anonymous session can only ever access public rooms, so a public room should not be hidden from an anon user's LHN just because it isn't the focused report. I'd add that as an override in
shouldDisplayReportInLHN:const shouldOverrideHidden = !!draftComment || hasErrorsOtherThanFailedReceipt || isFocused || + // An anonymous user can only access public rooms, and such a room's notification preference + // defaults to `hidden`. Without this, opening a thread inside the room (which steals focus) + // drops the room from the LHN, leaving the anon user unable to return to it. See #92672. + (isPublicRoom(report) && isAnonymousUser()) || isSystemChat || !!report.isPinned || // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing requiresAttention || (report.isOwnPolicyExpenseChat && !isReportArchived);Supporting change: import
isPublicRoomfrom./ReportUtilsandisAnonymousUserfrom./actions/SessioninSidebarUtils.ts.This pairs
isPublicRoomwithisAnonymousUser()exactly the wayReportUtilsalready gates anon-only public-room behaviour elsewhere, e.g. incanLeaveChat:App/src/libs/ReportUtils.ts
Lines 11313 to 11315 in 753ada2
Once this override is in place, the non-focused public room still passes the rest of
reasonForReportToBeInOptionList(it has areportName/type, is a chat room, is accessible to anon, and already has itsCREATED+ message actions loaded, so it isn't excluded as empty), so it renders normally in the Inbox.Edge cases:
isAnonymousUser()becomesfalse, the override no longer applies, and Public room not display in LHN after anon user login from a thread of public room #91931 already re-fetches the room with a real notification preference — so there's no regression and no double-handling.What alternative solutions did you explore? (Optional)
VIEWING_PUBLIC_ROOM_REPORT_ID(from Public room not display in LHN after anon user login from a thread of public room #91931) intoSidebarUtilsand override hidden only for that exact room. Rejected: it threads an Onyx value throughgetReportsToDisplayInLHN→updateReportsToDisplayInLHN→shouldDisplayReportInLHNfor no real gain — in an anon session the only rooms in Onyx are public rooms anyway, so the broaderisPublicRoom && isAnonymousUsercheck is simpler and just as safe.hiddennotification preference. Rejected: that mutates report/Onyx data and would ripple into unread/GBR, leave-room and other notification-driven logic — far more side effects than a display-only fix.currentReportIdis a single value consumed across the whole option-list pipeline; overloading it is regression-prone compared to a targeted override.mukhrr commentedon Jun 4, 2026
Proposal
What is the root cause of that problem?
This is Android native specific. In the Android app, after an anonymous user opens a public room from
/r/1540486774487195, then taps Inbox, the active route becomes the Inbox/sidebar route instead of the report route. That makes the route-derivedcurrentReportIDstop pointing at the public room.The related history is PR #91931, which fixed a similar anonymous public-room/thread case. That PR added
ONYXKEYS.VIEWING_PUBLIC_ROOM_REPORT_IDto remember the public room being viewed:https://github.com/Expensify/App/pull/91931/files#diff-5c9f08c7c2b10f6bba8a1eaa36d36e98c0e40c280f9158871296c4be2ffbd878R432-R435
It also updates that key from
ReportFetchHandlerwhen an anonymous user is focused on a public room:App/src/pages/inbox/ReportFetchHandler.tsx
Lines 272 to 278 in 22fb956
But that remembered public-room ID is only used for the anonymous-to-signed-in refetch case. The LHN/sidebar still derives its active report only from navigation state:
App/src/hooks/useSidebarOrderedReports.tsx
Lines 87 to 88 in 22fb956
That navigation state comes from
Navigation.getTopmostReportId(state):App/src/hooks/useCurrentReportID.tsx
Lines 63 to 75 in 22fb956
Then
useSidebarOrderedReportspasses that route-derived ID into the LHN filter:App/src/hooks/useSidebarOrderedReports.tsx
Lines 192 to 214 in 22fb956
The report-list filter only guarantees inclusion for the currently viewed report:
App/src/libs/ReportUtils.ts
Lines 9576 to 9580 in 22fb956
So on Android native, tapping Inbox makes the public room no longer look “focused” to the LHN, even though
VIEWING_PUBLIC_ROOM_REPORT_IDstill knows which anonymous public room should stay visible. Since this anonymous public room can otherwise look like an empty/non-joined room, it gets filtered out and the Inbox shows the empty “Woohoo! All caught up.” state.What changes do you think we should make in order to solve the problem?
In
useSidebarOrderedReports, useVIEWING_PUBLIC_ROOM_REPORT_IDas the effective current report only for anonymous users.Small diff sketch:
Also include
isAnonymousUserandviewingPublicRoomReportIDin the relevant memo/callback dependency lists.This keeps the fix scoped to anonymous public-room browsing. Authenticated users and normal Inbox behavior continue using the route-derived current report.
Add a regression test in
tests/unit/useSidebarOrderedReportsTest.tsx:QA should explicitly cover Android native:
https://staging.new.expensify.com/r/1540486774487195.What alternative solutions did you explore? (Optional)
We could make all public rooms bypass the LHN filters, but that is too broad and could show unrelated public rooms. Using
VIEWING_PUBLIC_ROOM_REPORT_IDis narrower because it only preserves the anonymous public room the user actually opened.melvin-bot commentedon Jun 4, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (
External)David-2002065 commentedon Jun 4, 2026
Proposal
What is the root cause of that problem?
The new effect added by PR #91931 is supposed to remember the public room an anonymous user is viewing (or whose thread they are viewing) in
VIEWING_PUBLIC_ROOM_REPORT_ID, but its guard never lets the thread case through.https://github.com/Expensify/App/blob/main/src/pages/inbox/ReportFetchHandler.tsx#L272-L278
isPublicRoomreadsreport?.visibility, and thread reports don't carry their ownvisibility— they inherit it from the parent room:https://github.com/Expensify/App/blob/main/src/libs/ReportUtils.ts#L1793-L1795
So whenever an anonymous user is viewing a thread of a public room,
isPublicRoom(report)isfalse, the effect bails out, and theisThread(report) ? report.parentReportID : reportIDbranch the author wrote is dead code. The Onyx key only ever gets set when the route happens to be the public room itself; the moment the anonymous user steps into a thread the public room context is no longer being tracked.That is exactly the QA flow:
/r/1540486774487195(the public room) → effect runs with the public room asreport,VIEWING_PUBLIC_ROOM_REPORT_IDis set ✓reportis now the thread,isPublicRoom(thread)returnsfalse, effect bails, and any later use ofVIEWING_PUBLIC_ROOM_REPORT_ID(most importantly thejoinPublicRoomIfNeededre-fetch after the user signs in https://github.com/Expensify/App/blob/main/src/pages/inbox/ReportFetchHandler.tsx#L188-L194 called from https://github.com/Expensify/App/blob/main/src/pages/inbox/ReportFetchHandler.tsx#L239-L247) can no longer reach the public room → the LHN ends up on the "Woohoo! All caught up." empty state.This is also why the same QA scenario didn't reproduce in the PR's original test plan: the PR demo started on the public room first, which let step 1 prime the Onyx key. Land on a thread URL directly (or do any state transition that re-runs this effect while on a thread) and the tracking is silently lost.
What changes do you think we should make in order to solve the problem?
I'd subscribe to the parent report and treat "thread of a public room" as a public-room context for the purposes of this effect. The ternary already encodes the intent — we just need to let that branch run.
useEffect(() => { - if (!isFocused || !reportID || !isPublicRoom(report) || !isAnonymousUser) { - return; - } - setViewingPublicRoomReportID(isThread(report) ? report.parentReportID : reportID); - }, [reportID, report, isAnonymousUser, isFocused]); + if (!isFocused || !reportID || !isAnonymousUser) { + return; + } + const isThreadOfPublicRoom = isThread(report) && isPublicRoom(parentReport); + if (!isPublicRoom(report) && !isThreadOfPublicRoom) { + return; + } + setViewingPublicRoomReportID(isThreadOfPublicRoom ? report.parentReportID : reportID); + }, [reportID, report, parentReport, isAnonymousUser, isFocused]);Concretely:
parentReportviaparentReportID(mirroring howchatReportis already subscribed in this file).isThreadOfPublicRoomfromisThread(report) && isPublicRoom(parentReport)so we use the parent's visibility, not the (always-empty) thread visibility.reportIDotherwise).I'd also add a regression test that mounts
ReportFetchHandlerwith an anonymous session and a thread whoseparentReportIDpoints at a public room, and assertsVIEWING_PUBLIC_ROOM_REPORT_IDends up equal to the parent'sreportID.What alternative solutions did you explore? (Optional)
isPublicRoomitself to walk the parent chain (e.g.isPublicRoom(report) || (isThread(report) && parent?.visibility === PUBLIC...)). Strongest competing fix: it removes the bug everywhereisPublicRoomis used today, including unrelated call sites likeReportFooter.tsx#L75andcanLeaveChatinReportUtils.ts#L11280. Rejected because those existing call sites intentionally distinguish "the room itself" from "a thread inside it" —ReportFooter's anonymous-composer optimistic state andcanLeaveChat's "anon can't leave a public room" guard would silently change meaning. Containing the parent-aware check inside the single effect that actually needs it keeps blast radius zero.joinPublicRoomIfNeeded/openReport(publicRoomID)directly from the thread-open path instead of relying on the Onyx key, eagerly re-hydrating the public room whenever an anonymous user lands on a thread. Rejected because it duplicates fetching with the existingfetchReport()flow and would refetch the public room on every focus change rather than only on the sign-in transition; it also wouldn't fix the deadisThread(report) ? report.parentReportID : reportIDbranch, which is a real bug regardless.VIEWING_PUBLIC_ROOM_REPORT_IDfrom the link-handling layer (e.g. whenLink.openLinkresolves a public-room report ID for an anonymous user) so the Onyx key is primed without depending on a React effect at all. Rejected because the focused-screen effect is the cheapest source of truth for "which public room is this anon session looking at right now" — moving it upstream means re-implementing focus tracking and dealing with route changes that don't go throughLink.openLink(e.g. in-appNavigation.navigatefrom a parent room into a child thread).[-]Anon user can't reach public room[/-][+][$250] Anon user can't reach public room[/+]74 remaining items
mallenexpensify commentedon Jul 30, 2026
Payment Summary
Contributor: @yusufdeveloper2903 paid $250 via Upwork
Contributor+: @brunovjk due $250 via NewDot
@yusufdeveloper2903 can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal.
https://www.upwork.com/jobs/~022082920102476221973
^ Test case created. Thx
melvin-bot commentedon Jul 30, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)yusufdeveloper2903 commentedon Jul 31, 2026
@mallenexpensify Thanks! I've accepted the job offer on Upwork
laurenreidexpensify commentedon Jul 31, 2026
$250 approved for @brunovjk
yusufdeveloper2903 commentedon Aug 3, 2026
@mallenexpensify friendly bump 🙂
mallenexpensify commentedon Aug 4, 2026
@yusufdeveloper2903 paid, summary updated above. Thx.
mkhutornyi commentedon Sep 6, 2026
The PR fixing this issue caused regression: Email - User is logged in and not redirected to User created room as the new user.
Especially, the culprit is the guard which was added in 4839c55 ("fix: keep public room in LHN for anonymous users on cold start").
More details: #99156 (comment)