[$175] [Auto] - Android - Public Room - Error appears when opening public room as anon user
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: v9.5.6-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/77804213/folder/13176964/41237765/1840872376?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: Windows 10/Chrome App Component: Chat Report View
Action Performed:
Preconditions: New fresh install only; never visit the public room before on Android app
- Open the Public room https://staging.new.expensify.com/r/1540486774487195 via link as anon-user
Expected Result:
Can open the Public room normally
Actual Result:
Error appears "Auth OpenReport returned an error" and app navigate to Concierge
Workaround:
Unknown
Platforms:
- [x] Android: App
- [ ] Android: mWeb Chrome
- [ ] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [x] Windows: Chrome
- [ ] MacOS: Chrome Safari
Screenshots/Videos
https://github.com/user-attachments/assets/85815ee2-8864-4801-89f5-4f789c6b001a
Applause Internal Information Exported by: Julia Ponikarchuk Bug ID: 7282011
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022108539599795198229
- Upwork Job ID: 2108539599795198229
- Last Price Increase: 2026-10-09
Issue Owner
Current Issue Owner: @roryabraham
While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/c91e16e8d2b98763d71f09c04abe38ecf6251f30e9c0f758c0514d09fccb6e79
⚠️ Preliminary analysis (low confidence): treat this as a starting point, not a conclusion.
I think the backend rejects one of the OpenReport calls that App sends on a cold-start deep link. App then follows its "deep-linked report not found" fallback, which sends the anonymous user to Concierge.
What the App code shows:
- On a fresh install there is no auth token, so App sends an unauthenticated
OpenReportfor the room in src/libs/actions/Link.ts:442-461. - App then waits for that report in Onyx. If it arrives with
errorFields.notFound, App goes to the last accessed report. An anonymous user has none, so App callsnavigateToConciergeChatin src/libs/actions/Link.ts:603-616 and src/libs/actions/Link.ts:624-634. - During this cold start, App can send up to three
OpenReportcalls for the same room. The first comes from the deep link. AuthScreens sends another in AuthScreensInitHandler.tsx:210-225. The re-fetch added for [Due for payment 2026-07-29] [$250] Anon user can't reach public room sends a third in src/DeepLinkHandler.tsx:229-258. - The error text "Auth OpenReport returned an error" does not exist in App, so the backend generates it.
Why I couldn't verify this:
- I couldn't query production logs in this run, so I don't know which
OpenReportcall failed or what error code it returned. - I didn't find an App PR in 9.5.6-0 that clearly changed this flow. That points to a native-only timing difference or a backend change.
- The issue is Android-only, and this run could only test on web.
To confirm:
- Reproduce on a fresh Android install.
- Find each
OpenReportrequest for room 1540486774487195 and its error code. - Check whether the failing call is the unauthenticated deep-link call or a later call made with the new anonymous session.
- Check whether the device created two anonymous accounts. That would mean the URL was handled twice, once from
getInitialURLand once from the nativeurlevent in src/DeepLinkHandler.tsx:100-196.
If the backend rejects a valid request, the fix is outside the App repo. An internal engineer would need to handle it.
Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (External)
Job added to Upwork: https://www.upwork.com/jobs/~022108539599795198229
Proposal
Please re-state the problem that we are trying to solve in this issue.
On a fresh Android install, opening a public-room deep link as an anonymous user can show “Auth OpenReport returned an error” and redirect to Concierge instead of displaying the room.
What is the root cause of that problem?
The exact cause is not yet confirmed. The cold-start flow can request the same room from multiple places: the unauthenticated deep-link handler in Link.ts, AuthScreensInitHandler, and the retry in DeepLinkHandler. An unsuccessful OpenReport response can then be treated as “not found,” triggering the fallback to Concierge. We need to establish whether the failure is due to duplicated/racing calls, anonymous-session initialization, or a legitimate backend rejection before changing the behavior.
What changes do you think we should make in order to solve the problem?
I'll reproduce the fresh-install deep-link path and trace the OpenReport requests, their authentication/session state, response codes, and the Onyx notFound transition. If the issue is client-side, I'll ensure the public-room deep link is processed once with a consistent anonymous session and avoid redirecting while a valid room load is still pending. I won't suppress genuine access errors or assume a client fix if logs show a backend problem.
I'll add regression coverage for the cold-start anonymous room link, repeated link events, and a truly unavailable room, and check that existing authenticated navigation still works.
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0163955a2ba22190aa
Proposal
Please re-state the problem that we are trying to solve in this issue.
Android - On a fresh install, opening a public room deep link as an unauthenticated/anonymous user fails with "Auth OpenReport returned an error" and redirects to Concierge instead of opening the public room.
What is the root cause of that problem?
On Android cold launch from an external intent/deep link, React Native triggers both Linking.getInitialURL() (lines 100–127 in src/DeepLinkHandler.tsx) and fires the native 'url' listener (Linking.addEventListener('url', ...) at lines 167–196) with the exact same initial URL.
While initialUrlProcessed.current guards against re-running getInitialURL() on unauthenticated re-renders, the Linking.addEventListener('url') handler lacks a de-duplication check against the already-processed initial URL. Consequently, during cold start on Android, openReportFromDeepLink is invoked twice in rapid succession in an unauthenticated state:
- The first call begins unauthenticated
openReportand anonymous session creation. - The concurrent duplicate call races with the pending session, sending a conflicting unauthenticated
OpenReportor triggering duplicate anonymous account creation. - When the conflicting request fails,
report.errorFields.notFoundis set in Onyx, activating the fallback insrc/libs/actions/Link.ts(lines 606–616) which callsnavigateToConciergeChat().
What changes do you think we should make in order to solve the problem?
- In
src/DeepLinkHandler.tsx, maintain a ref to track the last processed URL (lastProcessedUrl = useRef<string | null>(null)). - Set
lastProcessedUrl.current = urlwhenLinking.getInitialURL()successfully processes the initial URL. - In
Linking.addEventListener('url', (state) => { ... }), check ifstate.url === lastProcessedUrl.current. If the URL matches the one already processed on cold start, ignore the duplicate event. Clear or updatelastProcessedUrl.currentonly when a genuinely distinct deep link arrives or when navigating away. - Additionally in
src/libs/actions/Link.ts, ensureopenReportFromDeepLinkde-duplicates concurrent in-flight requests for the samereportIDwhen unauthenticated to prevent racing requests from clobbering Onyx state during cold boot.
What alternative solutions did you explore? (Optional)
Handling de-duplication solely at the network request queue layer (resolveOpenReportDuplicationConflictAction). However, intercepting and preventing the duplicate deep-link event at DeepLinkHandler.tsx prevents redundant authentication, Onyx connections, and navigation side-effects entirely.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
Root cause: On a fresh install, the anon session isn't established before OpenReport is called for the public-room deep link, so the API returns an auth error and the error handler bounces the user to Concierge. Fix approach: Ensure the anon session is initialised (or route through the unauthenticated public-room flow) before calling OpenReport from the deep link, and handle this specific error without navigating away. Verification: Fresh install, open the public room link as an anon user, and confirm the room opens without the auth error.
@thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Proposal
Please re-state the problem that we are trying to solve in this issue.
Android - On a fresh install, opening a public room deep link as an unauthenticated/anonymous user fails with "Auth OpenReport returned an error" and redirects to Concierge instead of opening the public room.
What is the root cause of that problem?
On Android cold launch from an external intent/deep link, React Native triggers both Linking.getInitialURL() (lines 100–127 in src/DeepLinkHandler.tsx) and fires the native 'url' listener (Linking.addEventListener('url', ...) at lines 167–196) with the exact same initial URL.
While initialUrlProcessed.current guards against re-running getInitialURL() on unauthenticated re-renders, the Linking.addEventListener('url') handler lacks a de-duplication check against the already-processed initial URL. Consequently, during cold start on Android, openReportFromDeepLink is invoked twice in rapid succession in an unauthenticated state:
- The first call begins unauthenticated
openReportand anonymous session creation. - The concurrent duplicate call races with the pending session, sending a conflicting unauthenticated
OpenReportbefore the first completes. - When the conflicting request fails,
report.errorFields.notFoundis set in Onyx, activating the fallback insrc/libs/actions/Link.ts(lines 606–616) which callsnavigateToConciergeChat().
What changes do you think we should make in order to solve the problem?
In src/DeepLinkHandler.tsx:
- Maintain a ref to track the last processed URL:
const lastProcessedUrl = useRef<string | null>(null);
- Store
urlintolastProcessedUrl.currentwhenLinking.getInitialURL()successfully resolves:
initialUrlProcessed.current = true;
lastProcessedUrl.current = url;
onInitialUrl(url as Route);
- In
Linking.addEventListener('url', (state) => { ... }), check ifstate.urlmatcheslastProcessedUrl.current. If it matches, ignore the duplicate event:
linkingChangeListener.current = Linking.addEventListener('url', (state) => {
if (state.url && state.url === lastProcessedUrl.current) {
return;
}
lastProcessedUrl.current = state.url;
What alternative solutions did you explore? (Optional)
- Handling de-duplication solely at the network request queue layer (
resolveOpenReportDuplicationConflictAction). However, intercepting and preventing the duplicate deep-link event atDeepLinkHandler.tsxprevents redundant authentication, Onyx connections, and navigation side-effects entirely.
What specific scenarios should we cover in automated tests?
In tests/unit/DeepLinkHandlerTest.tsx:
- Verify that when
Linking.getInitialURL()resolves with a public room URL andLinking.addEventListener('url')subsequently fires with the same URL,openReportFromDeepLinkis invoked exactly once. - Verify that when
Linking.addEventListener('url')fires with a genuinely new deep link URL during a warm session,openReportFromDeepLinkcorrectly processes the new URL.
Contributor details Your Expensify account email: [email protected] Upwork Profile link: https://www.upwork.com/freelancers/~0170d6b02e9440e604
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@thesahindia Eep! 4 days overdue now. Issues have feelings too...
@situchan Huh... This is 4 days overdue. Who can take care of this?
@situchan Still overdue 6 days?! Let's take care of this!
@situchan 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!
@situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@situchan Eep! 4 days overdue now. Issues have feelings too...
@situchan Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
@situchan Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
@situchan 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!