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-11-07] [$175] LHN - #admin room already read after signed up as "submit expense to my employer" intention #101182
Version Number: 9.4.78-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:https://test-management.browserstack.com/projects/2219752/test-runs/73892537/folder/13176724/41237069/1758021327?sort=%2Bidentifier Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: iPhone 13 / iOS 27 Beta / Safari, Samsung Galaxy A52 / Android 14 / Chrome App Component: Left Hand Navigation (LHN)
Action Performed:
Preconditions: Uninstall Expensify from your device
Steps:
Search for "Expensify" on Safari / Chrome
Click on the Expensify search result
Change the URL to staging so we can test this in the test environment
On the Expensify Homepage - select Organize my own expenses
Enter a public domain account in the email/phone number field (without +)
Click on Get Started
Click on Join
Click on "Submit expenses to my employer" from the intent selector on ND
Enters a first and last name
Click Continue
Navigate to Inbox
Expected Result:
the #admins conversation is unread on mobile web
Actual Result:
the #admins conversation is already read on mobile web. on Android chrome, it displayed as unread briefly then immediately changed to read state
After onboarding with "Submit expenses to my employer", the app points the web-only Side Panel at the brand-new #admins room. The Side Panel mounts a full ReportScreen for that room, and useMarkAsRead's one-shot mount effect marks the report read with no visibility or focus gate at all — so #admins gets marked read without the user ever opening it.
src/hooks/useMarkAsRead.ts:166-183 — the mount effect calls readNewestAction as soon as the list mounts. Its only guards are hasNewerActions || !isScrolledToEnd. Compare the report-change path just below it at :202, which correctly requires isVisible && Visibility.hasFocus(). Any mount of that list marks the room read, visible or not.
The #admins room is genuinely unread for a moment first: buildOptimisticChatReport creates it already-read (lastReadTime === lastVisibleActionCreated), then the server pushes the Concierge welcome message, which makes it unread — and the mount effect immediately consumes it. That round trip is the "unread briefly, then flips to read" flash on Android Chrome.
Supporting detail: why it fires on a phone, and how the guards got weaker
The narrow-screen path is a secondary defect.navigateAfterOnboarding.ts:157 calls openSidePanel(!shouldUseNarrowLayout) intending "don't show the panel on phones". But SidePanel.ts:11-15 only setsopenNarrowScreen: true on the truthy branch — it never clears it on the falsy one. Since NVP_SIDE_PANEL is a server-persisted NVP and useSidePanelDisplayStatus.tsx:21 reads openNarrowScreen on non-XL screens, a stale true silently defeats the intent and the panel does open on mWeb. Note RHPVariantTest/index.ts:74,88 hardcode openSidePanel(true) for other onboarding variants — on phones too. There is also a brief mount window even when hidden: SidePanel/index.tsx:29 bails only when isSidePanelTransitionEnded && shouldHideSidePanel.
Guard history. The ungated mount mark-as-read was introduced by #51366 (f32cd9fb45dd609ecc6bd887695a0437dc073e8c), moved verbatim into useMarkAsRead.ts by #91179, and only partially fenced by #100025 (merged 2026-09-15, i.e. after the reported 9.4.78-0 build). #100025 added shouldRequireScreenFocus, but it is passed only by MoneyRequestReportActionsList.tsx:314-324 — the chat list at ReportActionsList.tsx:200-206 leaves it at the false default, and even where it is passed it is only checked on the report-change path, never on mount.
Alternatives considered and ruled out in code. Nothing in onboarding, OpenApp/ReconnectApp handling, or the LHN marks a report read — readNewestAction for a chat room requires a mounted ReportActionsList. prepareOnboardingOnyxData never writes lastReadTime. On narrow layout SplitRouter.ts:107 does not push the central REPORT screen, so the Inbox itself cannot mount #admins. One non-lastReadTime alternative remains possible but unconfirmed: SidebarUtils.ts:831 suppresses the LHN bold when report.lastActorAccountID is falsy, and the optimistic value is 0.
Prior art.#61641 ("#admins room is unread with GBR, then automatically becomes read") is the same symptom. It was closed as not reproducible with no fixing PR, so there is no earlier fix that regressed.
What changes do you think we should make in order to solve the problem?
Gate the mount mark-as-read the same way the report-change path is gated. In useMarkAsRead.ts:166-183, require isVisible && Visibility.hasFocus() — and isFocused, to cover side-panel and frozen-screen mounts — before calling readNewestAction. This is the actual fix; the report should not be consumed by a surface the user never looked at.
Pass shouldRequireScreenFocus from the chat list at ReportActionsList.tsx:200-206, and honour it on the mount path, not just on report change.
Make openSidePanel symmetric. In SidePanel.ts:11-15, explicitly write openNarrowScreen: false when the caller passes a falsy shouldOpenOnNarrowScreen, so "don't open on phones" can't be defeated by a stale NVP.
Optionally, have navigateAfterOnboarding.ts:157 pass !isExtraLargeScreenWidth (1300px) rather than !shouldUseNarrowLayout (800px), so the flag it writes matches the breakpoint it is later read against.
Worth noting: on desktop web the panel opens by design and legitimately marks #admins read. If that is also undesirable, fixing only (1) will change desktop behaviour too — please confirm the intent before implementing.
What alternative solutions did you explore? (Optional)
Rendering the Side Panel's #admins view in a read-only mode that never calls readNewestAction would fix this flow specifically, but it leaves the ungated mount effect in place for every other surface that mounts a ReportActionsList off-screen — the same defect would resurface elsewhere.
Confidence and what is not yet verified
Medium confidence. The mechanism, the file:line references, and the web-vs-native split are all verified in code at 50b3c85. Two things are not confirmed:
I could not get a runtime repro — the test session was already broken (the CI prestart onboarding replay diverged, and the browser rendered a blank page), so nothing here is backed by live evidence.
Static analysis says that on a clean mWeb session openNarrowScreen is unset, so the panel should stay hidden. The stale-NVP path in (3) is the most likely explanation for it firing anyway, but it is inferred, not proven.
To settle both, check for ReadNewestAction / OpenReport calls against the new policy's chatReportIDAdmins within ~2s of CompleteGuidedSetup, bucketed by user agent, and inspect the NVP_SIDE_PANEL value (specifically openNarrowScreen) for an affected mWeb account at signup.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/101182) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
📣 @alimmiftah32-glitch! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
After onboarding with "Submit expenses to my employer", web opens the Side Panel on the new #admins room (navigateToSubmitWorkspaceAfterOnboarding → ONBOARDING_RHP_VARIANT.RHP_ADMINS_ROOM → SidePanelActions.openSidePanel, then SidePanelContextProvider resolves chatReportIDAdmins and SidePanelReport mounts a full ReportScreen).
That mount runs useMarkAsRead's one-shot initial effect (src/hooks/useMarkAsRead.ts, the effect that calls readNewestAction once on mount). That path only checks preloaded-tab / already-read / newer-actions / scrolled-to-end. It does not check isVisible, Visibility.hasFocus(), or isFocused.
The report-change and app-visibility paths in the same hook already require visibility/focus (and optionally shouldRequireScreenFocus). So a Side Panel #adminsReportScreen marks the room read as soon as the list mounts — even though the user never opened that chat in the LHN. That matches the bug (mWeb: already read; Android Chrome: brief unread then flip to read).
ReportActionsList also never passes shouldRequireScreenFocus, and today that flag is only consulted on the report-change path anyway — so even opting in would not protect the mount path.
What changes do you think we should make in order to solve the problem?
In the initialuseMarkAsRead effect, apply the same gates the other paths already use: require isVisible && Visibility.hasFocus(), and if shouldRequireScreenFocus is set, require isFocused. Do not call readNewestAction on a background Side Panel mount.
Wire shouldRequireScreenFocus into that initial effect (not only report-change), so callers that opt in are actually protected on mount.
From ReportActionsList when rendered inside the Side Panel (useIsInSidePanel), pass shouldRequireScreenFocus: true (same pattern as MoneyRequestReportActionsList).
Add / extend useMarkAsRead unit tests: Side Panel / unfocused mount must not mark read; focusing the real report still marks read.
No change to onboarding navigation intent (Side Panel may still open on #admins); we only stop treating that mount as “user read the room”.
What alternative solutions did you explore? (Optional)
Stop opening the Side Panel on #admins after employer onboarding — rejected; product wants Concierge Anywhere to show that room; the bug is false mark-as-read, not the panel itself.
Only latch on isInPreloadedTab — rejected; Side Panel is a parallel ReportScreen, not a preloaded main tab, so that guard never fires here.
Mark-as-read debounce / delay — rejected; hides the race without fixing the ungated mount path.
this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Precondition:
a fresh account on mWeb or a narrow web window.
Test:
Sign up with a new account
Click Join
Choose "Submit expenses to my employer" in the intent selector
Enter a first and last name and click Continue
Open Inbox without opening #admins
Verify #admins is unread and its preview is the Concierge "Welcome to Expensify! What do you want to do first?" message
Open #admins and verify the welcome message is there and the room is now read
Contributor: @mukhrr due $175 via NewDot
Contributor+: @eh2077 due $175 via NewDot
@mukhrr unfortunately, for now, Help Wanted has to be added in order for the price to be increased (it's a technicality for a handful of reasons). The assigned C+ can request an increase if they think the amount of work on a PR warrants it.
Activity
applause-bot commentedon Sep 15, 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/71c0734c0da54a5a676ee4a4e91e67b3a887da0636cbe0ac79168d07cddc7819
MelvinBot commentedon Sep 15, 2026
Proposal
What is the root cause of that problem?
After onboarding with "Submit expenses to my employer", the app points the web-only Side Panel at the brand-new
#adminsroom. The Side Panel mounts a fullReportScreenfor that room, anduseMarkAsRead's one-shot mount effect marks the report read with no visibility or focus gate at all — so#adminsgets marked read without the user ever opening it.The two links in the chain:
src/libs/navigateAfterOnboarding.ts:147-158— this intent's exit path setsONBOARDING_RHP_VARIANT.RHP_ADMINS_ROOMand callsopenSidePanel(). The variant makesSidePanelContextProvider.tsx:88-96resolve the panel'sreportIDtoactivePolicy.chatReportIDAdmins, andSidePanelReport/index.tsx:24renders a realReportScreenfor it.src/hooks/useMarkAsRead.ts:166-183— the mount effect callsreadNewestActionas soon as the list mounts. Its only guards arehasNewerActions || !isScrolledToEnd. Compare the report-change path just below it at:202, which correctly requiresisVisible && Visibility.hasFocus(). Any mount of that list marks the room read, visible or not.This also explains the reported platform matrix exactly. Native is structurally exempt —
RootNavigatorExtraContent/index.native.tsxnever renders<SidePanel>andisSidePanelReportSupported/index.native.ts:3returnsfalse. So the bug is web-only, matching iOS/Android App being unchecked in the report.The
#adminsroom is genuinely unread for a moment first:buildOptimisticChatReportcreates it already-read (lastReadTime === lastVisibleActionCreated), then the server pushes the Concierge welcome message, which makes it unread — and the mount effect immediately consumes it. That round trip is the "unread briefly, then flips to read" flash on Android Chrome.Supporting detail: why it fires on a phone, and how the guards got weaker
The narrow-screen path is a secondary defect.
navigateAfterOnboarding.ts:157callsopenSidePanel(!shouldUseNarrowLayout)intending "don't show the panel on phones". ButSidePanel.ts:11-15only setsopenNarrowScreen: trueon the truthy branch — it never clears it on the falsy one. SinceNVP_SIDE_PANELis a server-persisted NVP anduseSidePanelDisplayStatus.tsx:21readsopenNarrowScreenon non-XL screens, a staletruesilently defeats the intent and the panel does open on mWeb. NoteRHPVariantTest/index.ts:74,88hardcodeopenSidePanel(true)for other onboarding variants — on phones too. There is also a brief mount window even when hidden:SidePanel/index.tsx:29bails only whenisSidePanelTransitionEnded && shouldHideSidePanel.Guard history. The ungated mount mark-as-read was introduced by #51366 (
f32cd9fb45dd609ecc6bd887695a0437dc073e8c), moved verbatim intouseMarkAsRead.tsby #91179, and only partially fenced by #100025 (merged 2026-09-15, i.e. after the reported 9.4.78-0 build). #100025 addedshouldRequireScreenFocus, but it is passed only byMoneyRequestReportActionsList.tsx:314-324— the chat list atReportActionsList.tsx:200-206leaves it at thefalsedefault, and even where it is passed it is only checked on the report-change path, never on mount.Alternatives considered and ruled out in code. Nothing in onboarding,
OpenApp/ReconnectApphandling, or the LHN marks a report read —readNewestActionfor a chat room requires a mountedReportActionsList.prepareOnboardingOnyxDatanever writeslastReadTime. On narrow layoutSplitRouter.ts:107does not push the central REPORT screen, so the Inbox itself cannot mount#admins. One non-lastReadTimealternative remains possible but unconfirmed:SidebarUtils.ts:831suppresses the LHN bold whenreport.lastActorAccountIDis falsy, and the optimistic value is0.Prior art. #61641 ("#admins room is unread with GBR, then automatically becomes read") is the same symptom. It was closed as not reproducible with no fixing PR, so there is no earlier fix that regressed.
What changes do you think we should make in order to solve the problem?
Gate the mount mark-as-read the same way the report-change path is gated. In
useMarkAsRead.ts:166-183, requireisVisible && Visibility.hasFocus()— andisFocused, to cover side-panel and frozen-screen mounts — before callingreadNewestAction. This is the actual fix; the report should not be consumed by a surface the user never looked at.Pass
shouldRequireScreenFocusfrom the chat list atReportActionsList.tsx:200-206, and honour it on the mount path, not just on report change.Make
openSidePanelsymmetric. InSidePanel.ts:11-15, explicitly writeopenNarrowScreen: falsewhen the caller passes a falsyshouldOpenOnNarrowScreen, so "don't open on phones" can't be defeated by a stale NVP.Optionally, have
navigateAfterOnboarding.ts:157pass!isExtraLargeScreenWidth(1300px) rather than!shouldUseNarrowLayout(800px), so the flag it writes matches the breakpoint it is later read against.Worth noting: on desktop web the panel opens by design and legitimately marks
#adminsread. If that is also undesirable, fixing only (1) will change desktop behaviour too — please confirm the intent before implementing.What alternative solutions did you explore? (Optional)
Rendering the Side Panel's
#adminsview in a read-only mode that never callsreadNewestActionwould fix this flow specifically, but it leaves the ungated mount effect in place for every other surface that mounts aReportActionsListoff-screen — the same defect would resurface elsewhere.Confidence and what is not yet verified
Medium confidence. The mechanism, the file:line references, and the web-vs-native split are all verified in code at
50b3c85. Two things are not confirmed:openNarrowScreenis unset, so the panel should stay hidden. The stale-NVP path in (3) is the most likely explanation for it firing anyway, but it is inferred, not proven.To settle both, check for
ReadNewestAction/OpenReportcalls against the new policy'schatReportIDAdminswithin ~2s ofCompleteGuidedSetup, bucketed by user agent, and inspect theNVP_SIDE_PANELvalue (specificallyopenNarrowScreen) for an affected mWeb account at signup.Possibly related issues
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/101182)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run · no recording available
melvin-bot commentedon Sep 18, 2026
Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Sep 21, 2026
📣 @alimmiftah32-glitch! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
melvin-bot commentedon Sep 22, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
melvin-bot commentedon Sep 22, 2026
Still overdue 6 days?! Let's take care of this!
elecelias-ux commentedon Sep 23, 2026
Proposal
What is the root cause of that problem?
After onboarding with "Submit expenses to my employer", web opens the Side Panel on the new
#adminsroom (navigateToSubmitWorkspaceAfterOnboarding→ONBOARDING_RHP_VARIANT.RHP_ADMINS_ROOM→SidePanelActions.openSidePanel, thenSidePanelContextProviderresolveschatReportIDAdminsandSidePanelReportmounts a fullReportScreen).That mount runs
useMarkAsRead's one-shot initial effect (src/hooks/useMarkAsRead.ts, the effect that callsreadNewestActiononce on mount). That path only checks preloaded-tab / already-read / newer-actions / scrolled-to-end. It does not checkisVisible,Visibility.hasFocus(), orisFocused.The report-change and app-visibility paths in the same hook already require visibility/focus (and optionally
shouldRequireScreenFocus). So a Side Panel#adminsReportScreenmarks the room read as soon as the list mounts — even though the user never opened that chat in the LHN. That matches the bug (mWeb: already read; Android Chrome: brief unread then flip to read).ReportActionsListalso never passesshouldRequireScreenFocus, and today that flag is only consulted on the report-change path anyway — so even opting in would not protect the mount path.What changes do you think we should make in order to solve the problem?
useMarkAsReadeffect, apply the same gates the other paths already use: requireisVisible && Visibility.hasFocus(), and ifshouldRequireScreenFocusis set, requireisFocused. Do not callreadNewestActionon a background Side Panel mount.shouldRequireScreenFocusinto that initial effect (not only report-change), so callers that opt in are actually protected on mount.ReportActionsListwhen rendered inside the Side Panel (useIsInSidePanel), passshouldRequireScreenFocus: true(same pattern asMoneyRequestReportActionsList).useMarkAsReadunit tests: Side Panel / unfocused mount must not mark read; focusing the real report still marks read.No change to onboarding navigation intent (Side Panel may still open on
#admins); we only stop treating that mount as “user read the room”.What alternative solutions did you explore? (Optional)
#adminsafter employer onboarding — rejected; product wants Concierge Anywhere to show that room; the bug is false mark-as-read, not the panel itself.isInPreloadedTab— rejected; Side Panel is a parallelReportScreen, not a preloaded main tab, so that guard never fires here.melvin-bot commentedon Sep 24, 2026
Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
melvin-bot commentedon Sep 28, 2026
12 days overdue now... This issue's end is nigh!
melvin-bot commentedon Sep 29, 2026
this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
54 remaining items
melvin-bot commentedon Nov 6, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Nov 6, 2026
Payment Summary
Resolving PRs:
Flush staged WRITE updates before applying a catch-up response so #admins stays unread after onboarding #104433
Reviewer: @mukhrr owed $175 via NewDot
Reviewer: @eh2077 owed $175 via NewDot
BugZero Checklist (@mallenexpensify)
mukhrr commentedon Nov 7, 2026
I think payment is due $250 here
We were brought here without proposal before Help Wanted
And what melvin proposed was not enough to fix the bug
cc @dmkt9 @luacmartins
mallenexpensify commentedon Nov 9, 2026
@eh2077 plz complete the Contributor+ checklist and tag me in a post once you have. Thx
melvin-bot commentedon Nov 9, 2026
@eh2077 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
eh2077 commentedon Nov 10, 2026
Contributor+ Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: NA. This isn't a bug introduced by a previous PR, instead, it's a complement enhancement of this old issue [Tracking] "Replay effect" when sequential actions are taken offline, and user subsequently comes online #12775
Link to the comment on the Issue: NA
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
eh2077 commentedon Nov 10, 2026
@mallenexpensify thanks for the ping, checklist done. I also think payment should be $250 here.
mallenexpensify commentedon Nov 11, 2026
Payment Summary
Contributor: @mukhrr due $175 via NewDot
Contributor+: @eh2077 due $175 via NewDot
@mukhrr unfortunately, for now,
Help Wantedhas to be added in order for the price to be increased (it's a technicality for a handful of reasons). The assigned C+ can request an increase if they think the amount of work on a PR warrants it.flaviadefaria commentedon Nov 24, 2026
Approved: @mukhrr due $175 via NewDot
laurenreidexpensify commentedon Nov 26, 2026
Approved @eh2077 $175 New Expensify