Repository navigation
Description
Version Number: 9.4.50-0
Reproducible in staging?: Needs verification
Reproducible in production?: Yes (observed on production)
If this was caught during regression testing, add the test name, ID and link from BrowserStack: N/A
Email or phone of affected tester (no customers): vit@expensify.com
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @mountiny
Slack conversation (hyperlinked to channel name):
Action Performed:
- Sign in to New Expensify on web as an Expensify employee.
- Start a supportal session into another account from Expensify Classic.
- Watch the network tab (or backend request logs) while New Expensify finishes loading.
Expected Result:
Exactly one OpenApp request is sent for the newly opened session.
Actual Result:
Two OpenApp requests are sent back to back for the same session. Both run the full app-load payload, so the account pays the OpenApp cost twice.
Analysis
OpenApp has no in-flight deduplication, so two openApp() triggers inside the request window both reach the server.
openApp() sends the request through API.writeWithNoDuplicatesConflictAction, which resolves conflicts with resolveDuplicationConflictAction(persistedRequests, matcher):
That resolver only searches persistedRequests. processNextRequest() moves the request that is currently in flight out of persistedRequests and into ongoingRequest:
So while OpenApp #1 is in flight, the matcher finds nothing, the resolver returns push instead of replace, and OpenApp #2 is enqueued and sent.
ReconnectApp already closes this gap. writeWithNoDuplicatesReconnectConflictAction passes getOngoingRequest() into its resolver, so a ReconnectApp that arrives mid-flight is collapsed:
https://github.com/Expensify/App/blob/main/src/libs/API/index.ts#L71
OpenApp never got the equivalent treatment.
Is this supportal only?
No. The missing in-flight guard is generic — any account that produces two openApp() triggers close together sends two OpenApp requests. Supportal just raises the odds, because the flow signs the agent out, clears Onyx, signs in with the support auth token, and swaps the Public navigator for the Auth navigator. The openApp() trigger in AuthScreensInitHandler runs in a mount-only effect ([] deps), so every remount of AuthScreens fires another one:
The remount during a support login is already documented in signInWithSupportAuthToken, which added a token guard for the same reason:
Other openApp() callers can stack the same way — PriorityModeHandler, SignInModal, useIsLoadingAppRecovery, and the delegate paths in Delegate.ts.
Prior art
Fix doubled OpenApp on delegate (copilot) account switch was the same class of bug for copilot. It was fixed by removing the two specific triggers, not by adding deduplication, so the underlying gap stayed open.
App hangs when OpenApp / ReconnectApp / GetMissingOnyxMessages fire in rapid stampedes tracks the broader stampede symptom.
Proposed fix
Give OpenApp the same in-flight awareness ReconnectApp has: feed getOngoingRequest() into the conflict resolver so a second OpenApp is dropped or collapsed while one is already running. Fixing it at the dedupe layer covers every trigger at once, instead of chasing each caller.
Workaround:
Yes, users can keep using Expensify. The duplicate request is invisible in the UI beyond a slower app load, and it is more noticeable on large accounts.
Platforms:
Select the officially supported platforms where the issue was reproduced:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
Screenshots/Videos
Issue Owner
Current Issue Owner: @mallenexpensifyMetadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
mountiny commentedon Aug 6, 2026
a26feebd7f2f29a7-ZRH were the two requests I saw a26fef1b794629a7-SJC
mountiny commentedon Aug 6, 2026
Production log evidence: this is not supportal only
I checked VictoriaLogs to confirm the "Is this supportal only?" section above. It is not. Regular accounts on all three platforms send the duplicate
OpenApp, and the rate is high.Measurement
Production only, staging excluded. Window
2026-08-06 17:30:00Zto17:40:00Z.OpenApprequestsI then pulled every request in that window with
_time, account,policyIDListandclientUpdateID, sorted per account, and measured the gap between consecutiveOpenAppcalls from the same account:69 of 459 requests (15.0% of all
OpenApptraffic) arrived within 5 seconds of the same account's previousOpenApp. 58 accounts (16.5% of accounts active in the window) had at least one such repeat. Sub-second gaps down to 0.19s were common.A gap under 5 seconds cannot be a second app open by the user.
OpenAppitself takes 5–7s server side on a mid-size account, so the second request is fired while the first is still in flight — exactly thepushinstead ofreplacepath described above.Platform split
Platform of the first request in each < 5s pair:
Roughly proportional to traffic. No platform is spared.
Request fingerprint
The pair has a consistent signature that makes it easy to spot in logs.
policyIDListon the two consecutive calls:empty→populated: 33empty→empty: 30populated→populated: 6The first call carries
policyIDList: ''because Onyx has just been cleared or hydrated. The second call carries the real policy IDs because call #1's response has already landed.There is a second, cleaner marker: the first request has no
pusherSocketIDparameter at all, the second one does.makeRequest.tsreadsPusher.getPusherSocketID(), which isundefineduntil Pusher connects. So call #1 is fired before Pusher init completes and call #2 after it. Shape of a pair from a regular web account, 0.80s apart:Same IP, same
HTTP_CF_JA4fingerprint on both, so this is one client, not two tabs.The supportal session that opened this issue
Client-side
openApp()was called 5 times, and 4 of them reached the server as fullOpenApprequests. Two of the client calls were only 193ms apart.Server side (staging), the two requests named in the report plus two earlier ones:
Each of the last two returned a 14.8MB Auth payload and took 6.3s and 7.5s respectively, ~88% of it inside Auth. So the doubled cost is real, not just an extra round trip.
The client logs show what triggers the refire at
17:58:56:An in-flight
OpenAppis aborted by the session teardown, thenopenApp()fires twice more 193ms apart. Between those two calls the queue logged:so the first of the pair was already queued when the second arrived, and both still went out. The 15s wall-clock gap between the two server requests is the sequential queue holding request #2 until #1 finished, not a 15s pause in the client.
Bottom line
The supportal flow makes it near certain by clearing Onyx and remounting
AuthScreens, but the missing in-flight guard fires for ordinary logins too, at roughly 15% of allOpenApptraffic. Fixing it at the dedupe layer as proposed covers both.Reproducing
BartekObudzinski commentedon Aug 11, 2026
I didn't know about this issue but I found simillar case on Sentry when I was investigating Inbox. It looks like simillar case to this one I have already prepared changes just I need to test it
6 remaining items
[-]OpenApp fires twice on supportal login: no in-flight deduplication for OpenApp[/-][+][Due for payment 2026-08-21] OpenApp fires twice on supportal login: no in-flight deduplication for OpenApp[/+]melvin-bot commentedon Aug 14, 2026
@daledah
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.53-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-08-21. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
daledah commentedon Aug 16, 2026
BugZero 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: N/A
[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:
[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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/674195
Regression Test Proposal
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-e201-a2b7-15b9-82880147d454melvin-bot commentedon Aug 17, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Aug 20, 2026
Payment Summary
Resolving PRs:
fix: dedupe OpenApp against an in-flight OpenApp #98266
Contributor: @adhorodyski does not require payment (Contractor)
Reviewer: @daledah owed $250 via NewDot
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Aug 21, 2026
Payment Summary
Contributor+: @daledah due $250 via NewDot