Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.4.94-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/75704627/folder/13176909/41237458/1798309092?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: Android 16 / Honor x6b
App Component: Other
Action Performed:
Precondition: User A has already set Xero connection
Test 2 — OldDot Flow (Android and iOS only)
- Create a new account (User B) in the Hybrid App.
- Navigate to Settings and switch to Expensify Classic.
- Sign out from Classic (OldDot).
- As User A, add User B's account to the workspace where the Xero connection is established.
- Make sure User B is invited as an Admin.
- Sign in as User B in the Hybrid App.
- Enter the magic code.
- Verify that a prompt to enable 2FA is displayed from OldDot.
Result: User is redirected to the NewDot 2FA flow. - Click Enable 2FA.
Result: Security tab with interactive tep analysis modal appears briefly - Validate the account with the magic code if prompted.
- Complete the 2FA setup flow.
Result: After entering the authentication code, the current step restarts and prompts the user to enter the authentication code again. - Click Got it.
- Verify that all OldDot content loads properly.
Result: User remains in NewDot.
Expected Result:
When signin User B must land in Old to enable 2FA. After entering the authentication code during the 2FA setup, the authentication step should complete successfully, and the user should remain in OldDot with all OldDot content loaded properly.
Actual Result:
When signin User B must land in ND to enable 2FA. After entering the authentication code, the authentication step restarts and prompts the user to enter the code again. After clicking Got it, the user is taken directly to NewDot instead of loading OldDot content.
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome Safari
Screenshots/Videos
Bug7271611_1790606600227.document_5030948313407424565.mp4
Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7271611
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022104617040252326734
- Upwork Job ID: 2104617040252326734
- Last Price Increase: 2026-10-14
Issue Owner
Current Issue Owner: @madmax330Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
applause-bot commentedon Sep 28, 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/657b6def396938605cbcb4424bbc08ac17a8f4fed49ca0ad9c55e42d9bb810be
[-]2FA-User admin is redirected to NewDot instead of completing the OldDot 2FA flow for Xero[/-][+]2FA - User admin is redirected to NewDot instead of completing the OldDot 2FA flow for Xero[/+]MelvinBot commentedon Sep 28, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
A HybridApp user who must set up 2FA completes the NewDot 2FA flow, but the verify step restarts after a valid code. When they tap "Got it", they stay in NewDot instead of going back to Expensify Classic (OldDot).
What is the root cause of that problem?
There are three parts to this issue:
HybridApp.ts:120keeps users in NewDot until they finish required 2FA. fix: keep user in ND until they setup 2FA when required added this after OldDot skipped the 2FA screen. The test case expects an OldDot 2FA prompt, which is out of date.DynamicSuccessPage.tsx:97only returns to OldDot whennvp_tryNewDot.classicRedirect.dismissedis true. After a valid code,validateTwoFactorAuthclears Onyx in both branches (Session/index.ts:1492-1521).NVP_TRY_NEW_DOTis not in either list of kept keys (App.ts:144-170). In the forced-onboarding branch,openApp()waits until "Got it", so the flag is always missing and the user goes to NewDot. Required 2FA setup screen is unresponsive, blocking new-domain login and account merge added that branch.HAS_LOADED_APPand personal details whileOpenAppis loading.useIsAgentAccountthen returnsundefined. As a result,withAgentAccessDeniedrendersnull, which unmounts the verify page, and the page mounts again with an empty code field. [No QA] Use server agent identity in App added this gate.The Security tab flash in step 9 comes from the overlay route change to
ROUTES.SETTINGS_SECURITY(RequireTwoFactorAuthenticationOverlay.tsx:95), which also came from PR 94486.What changes do you think we should make in order to solve the problem?
ONYXKEYS.NVP_TRY_NEW_DOTin both lists of kept keys invalidateTwoFactorAuth. This lets "Got it" run the existingcloseReactNativeAppcheck. It is the same account, so keeping this value is safe.OpenApp. For example,useIsAgentAccountcould keep the last known value for the same account, or the wipe could keepHAS_LOADED_APPand the current user's personal details.classicRedirect.dismissed = true, "Got it" callscloseReactNativeApp.What alternative solutions did you explore? (Optional)
HybridApp.ts:120keeps the user in NewDot only because of 2FA, save a flag inONYXKEYS.HYBRID_APP, which already survives the wipe. The success page would read the flag and then clear it. This matches the original sign-in decision more closely, including whenclassicRedirectis empty.Confidence and open questions
nvp_onboarding.hasCompletedGuidedSetupFlow. In the other branch,openApp()runs right away, so "Got it" works only ifOpenAppreturnsnvp_tryNewDotfirst.Possibly related: [$250] Required 2FA setup screen is unresponsive, blocking new-domain login and account merge is the issue that PR 94486 fixed.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/102437)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Sep 28, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (
External)[-]2FA - User admin is redirected to NewDot instead of completing the OldDot 2FA flow for Xero[/-][+][$175] 2FA - User admin is redirected to NewDot instead of completing the OldDot 2FA flow for Xero[/+]melvin-bot commentedon Sep 28, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022104617040252326734
ashusatyarthi-wq commentedon Sep 28, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
In HybridApp (Android/iOS), when a user invited as an Admin to a workspace connected to Xero is required to set up 2FA, they are redirected to NewDot to complete 2FA setup. However:
What is the root cause of that problem?
There are two interrelated root causes:
Failure to return to OldDot ("Got it" button):
In
src/pages/settings/Security/TwoFactorAuth/DynamicSuccessPage.tsx(lines 97–100):isClassicRedirectDismissedrelies ontryNewDot?.classicRedirect?.dismissedfromONYXKEYS.NVP_TRY_NEW_DOT.However, during 2FA validation in
src/libs/actions/Session/index.ts(validateTwoFactorAuth),clearOnyxAndSeedFullReconnectis called to wipe stale pre-2FA Onyx data.Neither
KEYS_TO_PRESERVEinsrc/libs/actions/App.ts(lines 144–171) norkeysToPreserveForForcedOnboarding2FA/keysToPreserveWithPrivatePersonalDetailsinSession/index.tspreserveONYXKEYS.NVP_TRY_NEW_DOT.Because
NVP_TRY_NEW_DOTis wiped andopenApp()has not yet repopulated it before the user taps "Got it",tryNewDotisundefined,isClassicRedirectDismissedevaluates toundefined(falsy), and the app skipscloseReactNativeApp(), leaving the user stranded in NewDot.Verification step restarting after entering code:
When
clearOnyxAndSeedFullReconnectwipes Onyx data upon code submission,ONYXKEYS.PERSONAL_DETAILS_LISTandONYXKEYS.HAS_LOADED_APPare stripped.In
src/libs/Navigation/AppNavigator/withAgentAccessDenied.tsx:useIsAgentAccount()depends on the current user's entry inPERSONAL_DETAILS_LIST. When stripped,useIsAgentAccount()temporarily returnsundefined, causingwithAgentAccessDeniedto rendernull. This unmounts the activeTwoFactorAuthflow screens. Once the reconnection resolves and sets Onyx state, the component remounts from scratch with empty input fields, making it appear to the user as if the verification step restarted.What changes do you think we should make in order to solve the problem?
Preserve
ONYXKEYS.NVP_TRY_NEW_DOTacross 2FA reconnects:In
src/libs/actions/App.ts:Add
ONYXKEYS.NVP_TRY_NEW_DOTtoKEYS_TO_PRESERVEso that HybridApp routing state and Classic redirect preferences survive Onyx wipes during 2FA validation:(Additionally, include
ONYXKEYS.NVP_TRY_NEW_DOTinkeysToPreserveForForcedOnboarding2FAinsrc/libs/actions/Session/index.tsto ensure explicit coverage across all onboarding branches).Prevent premature unmount during 2FA validation in
Session/index.ts:In
src/libs/actions/Session/index.ts:Preserve
ONYXKEYS.PERSONAL_DETAILS_LISTalongsideONYXKEYS.PRIVATE_PERSONAL_DETAILSinkeysToPreserveForForcedOnboarding2FAandkeysToPreserveWithPrivatePersonalDetails. This preventsuseIsAgentAccountfrom resolving toundefinedduring reconnect, keeping the 2FA verification and success screens stable and mounted throughout the transition.Fallback in
DynamicSuccessPage.tsx:In
DynamicSuccessPage.tsx, checkisClassicRedirectDismissedwith fallback toONYXKEYS.HYBRID_APPstate iftryNewDotmetadata is still resolving, guaranteeingcloseReactNativeAppis reliably dispatched on HybridApp.What alternative solutions did you explore? (Optional)
ONYXKEYS.HYBRID_APP: WhileHYBRID_APPis preserved,ONYXKEYS.NVP_TRY_NEW_DOTrepresents the source of truth for user preference between NewDot and Classic across the app. PreservingNVP_TRY_NEW_DOTdirectly inKEYS_TO_PRESERVEis architecturally cleaner and prevents regression across other HybridApp transitions.Contributor details:
Your Expensify account email: ashusatyarthi@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~010e53044b5828fe60
franklincg commentedon Sep 28, 2026
Proposal
Root cause
The HybridApp is correctly keeping a user in NewDot while 2FA is required. The regression happens when the 2FA validation path clears and reseeds Onyx before the success screen decides whether it should hand control back to Classic.
For the normal forced-2FA path,
ToggleTwoFactorAuthFormsetsshouldClearDatawhenneedsTwoFactorAuthSetupis true.validateTwoFactorAuth()then callsclearOnyxAndSeedFullReconnect([...KEYS_TO_PRESERVE, PRIVATE_PERSONAL_DETAILS]).The problem is that
KEYS_TO_PRESERVEdoes not includeONYXKEYS.NVP_TRY_NEW_DOT. The success page later checks:tryNewDot?.classicRedirect?.dismissedto decide whether
Got itshould callcloseReactNativeApp(). By then the Classic redirect state can already have been removed by the 2FA reconnect, so the success page falls through and remains in NewDot.That same reconnect is also why the verify step can briefly restart: the 2FA flow is still mounted while account/session state is being cleared and rebuilt.
Fix
I would keep the existing “stay in NewDot until required 2FA is complete” behavior and make the post-validation handoff preserve the HybridApp redirect intent across the reconnect.
Concretely:
ONYXKEYS.NVP_TRY_NEW_DOTin the login-required 2FA clear/reseed path used by HybridApp;DynamicSuccessPagecondition close NewDot only when Classic redirect is actually requested and not blocked.I would not change
HybridApp.signInToOldDotAndChooseExperience()to send the user to OldDot before 2FA. That would undo the intentional fix that keeps required-2FA users in NewDot until setup is complete.Validation
I would cover:
Got itreturns to OldDot.This keeps the fix scoped to preserving the redirect state across the 2FA reconnect rather than changing the intended HybridApp routing policy.
melvin-bot commentedon Oct 1, 2026
@thesahindia Whoops! This issue is 2 days overdue. Let's get this updated quick!
47 remaining items
github-actions commentedon Oct 15, 2026
huult commentedon Oct 16, 2026
huult commentedon Oct 16, 2026
open5588 commentedon Oct 16, 2026
@huult Great catch on what happens at
0:12! I traced why clicking "Clear cache and restart" makes "Switch to Expensify Classic" appear briefly for an ineligible account:TroubleshootPage.tsx(lines79–92), confirming "Clear cache and restart" callsclearOnyxAndResetApp()(src/libs/actions/App.ts#L617-L672), which runsclearOnyxAndSeedFullReconnect(KEYS_TO_PRESERVE)followed byopenApp().ONYXKEYS.NVP_TRY_NEW_DOTis not inKEYS_TO_PRESERVE,tryNewDotbecomesundefinedimmediately whileopenApp()is in flight. At the same time,useOnyx(ONYXKEYS.NVP_TRY_NEW_DOT)hastryNewDotMetadata.status === 'loaded', soisLoadingTryNewDot(isLoadingOnyxValue(tryNewDotMetadata)) evaluates tofalseeven thoughONYXKEYS.IS_LOADING_APPwas seeded totrue.shouldHideOldAppRedirect(tryNewDot, isLoadingTryNewDot, ...)(src/libs/TryNewDotUtils.ts#L36-L42), whentryNewDotisundefinedandisLoadingTryNewDotisfalse,isOldAppRedirectBlocked(undefined, ...)returnsfalse, soTroubleshootPagerenders "Switch to Expensify Classic" during theopenApp()request window.I have updated my proposal above with the exact root cause and fix (
isLoadingApp/isEmptyObject(tryNewDot)guard inTroubleshootPage.tsx&TryNewDotUtils.ts/ preservingONYXKEYS.NVP_TRY_NEW_DOT).huult commentedon Oct 16, 2026
At 0:12 in the ticket video, I can see QA clicking “Clear Cache and Restart,” which makes the “Switch to Expensify Classic” button appear briefly and allows them to click it. However, the test account used above is not actually eligible to use Classic.
User B has
dismissed: falseandisLockedToNewDot: true, which is the default state for a new account. New accounts should not have access to Classic, so not returning to OldDot after clicking “Got it” is likely the expected behavior.Therefore, I don't think this is a bug. However, preventing the “Switch to Expensify Classic” button from appearing for accounts that aren't eligible to use Classic is already accepted as out of scope for this ticket, as discussed here: #93358 (comment)
So, I think we should consider two options:
🎀 👀 🎀 c+ reviewed.
melvin-bot commentedon Oct 16, 2026
Triggered auto assignment to @madmax330, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
melvin-bot commentedon Oct 16, 2026
open5588 commentedon Oct 16, 2026
Contributor details
Your Expensify account email: open5588@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0109a026dfa4d0a6ea
melvin-bot commentedon Oct 16, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
madmax330 commentedon Oct 16, 2026
I think this is too edge case and we can just close, thanks @huult