Skip to content

[Payment due @huult] Keep the page across a forced SAML re-auth - #100475

Merged
mountiny merged 14 commits into
Expensify:mainfrom
allgandalf:saml-reauth-keep-path
Sep 10, 2026
Merged

mountiny merged 14 commits into
Expensify:mainfrom
allgandalf:saml-reauth-keep-path

Conversation

@allgandalf

Copy link
Copy Markdown
Contributor

Explanation of Change

On a domain with SAML required the app can't sign back in quietly when the session expires. It reloads through the sign on page and lands on home, so search filters and the open report are lost every 2h.

The page the user was on survives the forced re-auth and the app goes back there after signing in. A normal sign out still starts on home.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/674363
PROPOSAL:

Tests

Needs an account on a domain with SAML required.

  1. Sign in on web and open Reports.
  2. Apply a filter, for example status:outstanding, and note the URL.
  3. Open the test tools menu and press Invalidate auth token.
  4. Verify the app goes through the sign on page and comes back to the same Reports URL with the filter applied.
  5. Sign out, sign in again, verify it lands on home.
  • Verify that no errors appear in the JS console

Offline tests

  1. Same as above, but go offline right after pressing Invalidate auth token.
  2. Verify nothing happens while offline, and once back online the re-auth runs and returns to the same page.

QA Steps

Same as tests, on an account whose domain has SAML required.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@mountiny
mountiny requested a review from huult September 7, 2026 09:45
@allgandalf
allgandalf marked this pull request as ready for review September 7, 2026 09:50
@allgandalf
allgandalf requested review from a team as code owners September 7, 2026 09:50
@melvin-bot
melvin-bot Bot requested review from Pujan92 and removed request for a team September 7, 2026 09:50
@melvin-bot

melvin-bot Bot commented Sep 7, 2026

Copy link
Copy Markdown

@Pujan92 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot requested review from dylanexpensify and removed request for a team September 7, 2026 09:50
@allgandalf
allgandalf requested review from mountiny and removed request for Pujan92 and dylanexpensify September 7, 2026 09:51

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7f04f0354

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/libs/actions/Session/index.ts Resolved
@huult

huult commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
Screen.Recording.2026-09-10.at.14.38.30.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-09-10.at.14.50.36.mov

@huult

huult commented Sep 8, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-09-08.at.10.27.22.mov

BUG: After re-authentication, the profile is redirected to Home instead of the Account tab.

@huult

huult commented Sep 8, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-09-08.at.10.39.41.mov

BUG: After re-authentication, the app redirects to Home.

  1. Go to the Spend tab.
  2. Open the Test Tool and click Invalidate under Authentication Status.
  3. The app redirects to the IdP login page. Tap Home to send the app to the background.
  4. Reopen the app. The app redirects to Home instead of returning to the Spend tab.

@huult

huult commented Sep 8, 2026

Copy link
Copy Markdown
Contributor
    describe('saveCurrentPathBeforeBackground (triggered via the AppState listener)', () => {
        beforeEach(() => {
            // The listener only saves the path on a transition into background from 'active', so put it in 'active' first.
            emitAppState('active');
        });

        it('keeps the path a forced SAML re-auth preserved instead of overwriting it with the token-bearing /transition URL when the app backgrounds on that screen', async () => {
            // Given a forced SAML re-auth preserved the path the user was on before being signed out
            await Onyx.set(ONYXKEYS.LAST_VISITED_PATH, '/search?q=status:outstanding');

            // And the app is currently sitting on the public /transition screen with a short-lived token in the URL
            // (e.g. the SAML browser just redirected back into the app)
            mockedIsReady.mockReturnValue(true);
            mockedGetRootState.mockReturnValue(
                createMock<ReturnType<typeof navigationRef.getRootState>>({
                    routes: [{name: SCREENS.TRANSITION_BETWEEN_APPS, key: 'transition-key'}],
                    index: 0,
                }),
            );
            mockedGetPathFromState.mockReturnValue('/transition?shortLivedAuthToken=abc123&isSAML=true');

            // When the app is backgrounded (e.g. because the in-app SAML browser opened)
            emitAppState('background');
            await waitForBatchedUpdates();

            // Then LAST_VISITED_PATH must still be the path the SAML re-auth was supposed to return the user to,
            // not the token-bearing /transition URL the background handler is not supposed to persist.
            expect(await getOnyxValue(ONYXKEYS.LAST_VISITED_PATH)).toBe('/search?q=status:outstanding');
        });
    });
    

App/tests/actions/AppTest.ts

@allgandalf Could you try simulating this case? We might end up saving the last visited path with a token, which we don't want.

@huult

huult commented Sep 8, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-09-08.at.10.57.08.mov

BUG: Redirects to Inbox instead of the Inbox chat

  1. Open a workspace chat.
  2. Open any report.
  3. Open the Test Tool and trigger re-authentication.
  4. Go back to the workspace chat.
  5. Press Back from the workspace.

@huult

huult commented Sep 8, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-09-08.at.11.24.17.mov

@allgandalf It’s not working on web.

@allgandalf

allgandalf commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor Author

BUG: After re-authentication, the profile is redirected to Home instead of the Account tab.

good catch, the go back after landing was popping the page 4s later. fixed in fcd2e36

BUG: After re-authentication, the app redirects to Home.

  1. Go to the Spend tab.
  2. Open the Test Tool and click Invalidate under Authentication Status.
  3. The app redirects to the IdP login page. Tap Home to send the app to the background.
  4. Reopen the app. The app redirects to Home instead of returning to the Spend tab.

same fix, the page is restored right after sign in now so the second round trip keeps it. btw the first sign in gets dropped 2s after the OldDot side sign in and it goes round again, that one is separate from this PR

@allgandalf Could you try simulating this case? We might end up saving the last visited path with a token, which we don't want.

good call, the transition screen is excluded from lastVisitedPath now, test in bcb39ce

BUG: Redirects to Inbox instead of the Inbox chat

the back stack now matches a cold start restore of that page, so back from the chat goes to inbox. same commit as the first one

@allgandalf It’s not working on web.

that web run wasn't on this branch, it logged appversion 9.4.57-0 with isFromDevEnv false while your ios runs were 9.4.72-2 from the branch. can you retry web on the branch ?

Screenshot 2026-09-08 at 11 25 42 AM

Oh i actually see you're on new.expensify.com and not dev, can you please check 😅

@codecov

codecov Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/CONST/runtimeConfigured.ts 100.00% <ø> (ø)
src/CONST/runtimeDefaults.ts 100.00% <ø> (ø)
src/libs/Navigation/NavigationRoot.tsx 77.67% <100.00%> (ø)
src/libs/actions/App.ts 64.43% <100.00%> (+3.80%) ⬆️
src/libs/actions/Session/index.ts 60.35% <100.00%> (+1.19%) ⬆️
src/libs/actions/SignInRedirect.ts 82.14% <100.00%> (+0.66%) ⬆️
src/pages/LogInWithShortLivedAuthTokenPage.tsx 95.65% <100.00%> (+17.87%) ⬆️
src/pages/signin/SAMLSignInPage/index.native.tsx 90.24% <100.00%> (+31.70%) ⬆️
... and 1165 files with indirect coverage changes

@allgandalf

Copy link
Copy Markdown
Contributor Author

@allgandalf It's still not working on my side. I believe the app is fresh and there's no cache. I've also removed new.expensify.com from the hosts override already.

you're right, these runs are on the branch, my earlier reply was about the mWeb one. on android the chrome tab backgrounds the app and that saved /inbox over the kept path, fixed in dd4f9ac1b6b logs https://www.expensify.com/_devportal/tools/logSearch/#query=request_id%3Ain%28a38440f13c98fceb-SJC%2C+a38440f13c94fceb-SIN%2C+a38440f13c86fceb-SJC%2C+a3844112580afceb-LAX%2C+a38444632e6756f8-LAX%29+%28%22SAML+sign+in+failed%22+OR+%22Saving+current+path+before+background%22+OR+%22Auth+session+closed+without%22+OR+%22Successfully+received+shortLivedAuthToken%22+OR+%22Redirecting+to+Sign+In+because+SAML%22%29+_time%3A%5B2026-09-09T06%3A49%3A00%2C+2026-09-09T06%3A52%3A00%5D

  • Android: It doesn't work.

the "error occurred, try again" bounce right after the reauth is separate, on a dev build the SAML page opens twice and the second one fails, same on your iOS run https://www.expensify.com/_devportal/tools/logSearch/#query=request_id%3Ain%28a3845ee87f758de2-LAX%2C+a3845ee86f648de2-SIN%2C+a3845eebc9e48de2-LAX%29+%28%22SAML+sign+in+failed%22+OR+%22Redirecting+to+Sign+In+because+SAML%22%29+_time%3A%5B2026-09-09T07%3A09%3A00%2C+2026-09-09T07%3A11%3A00%5D that's on main too, i'll raise it separately. with the fix the retry should land on the kept page on android as well

  • iOS: I can navigate to the last path, but when I go back, it goes back to Home instead of Account, is this a expected behaviors?

it's rebuilt the same way a cold start restores the last page, so back should go to Account. can you check what a fresh launch on Profile does on that simulator ? if that also goes Home i'll dig in

@huult

huult commented Sep 10, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-09-10.at.10.23.30.mov

@allgandalf I still haven't been able to verify it on Android. Could you check it again on your side?

@huult

huult commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot review

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Code review of the current branch (dd4f9ac). The approach is sound — gating both lastVisitedPath writers on the session and preserving the key across a forced re-auth is the right shape. Four things I'd want changed or confirmed before approval.

1. waitForUserSignIn() has a single resolver slot — this adds a third competitor

authPromiseResolver is one variable, not a list, and waitForUserSignIn() overwrites it. Whoever registers last wins; every earlier promise never resolves.

The new call at Session/index.ts:892 now runs on every 2h re-auth, and it collides with openReportFromDeepLink. Open a report deep link while sitting on the sign-in page mid re-auth and one of the two silently loses: either the deep link is dropped, or resetRoot never fires and the page restore no-ops.

Navigation.waitForProtectedRoutes() already implies a signed-in session — protected routes only mount when authenticated. Dropping waitForUserSignIn() and keeping only waitForProtectedRoutes() gets the same guarantee without touching the shared slot.

2. getAdaptedStateFromPath throws, and nothing catches it

It throws when it can't build a state, and here it runs inside a .then() with no .catch(). exitTo is a persisted path that can outlive the bundle that wrote it — a route renamed or removed since the last session gives an unhandled rejection and no navigation at all. Wrap it and fall back to ROUTES.HOME.

3. The wrong-account guard is skipped when login is empty

if (login && deprecatedSession.email?.toLowerCase() !== login.toLowerCase()) {

If credentials.login is empty at call time the guard is bypassed entirely and any later sign-in lands on the previous user's page. That's the exact hazard documented at DeepLinkHandler.tsx:89-96. It holds today because SignInRedirect preserves CREDENTIALS, but that's an invariant one line elsewhere can break. Invert it to fail closed: if (!login || session.email?.toLowerCase() !== login.toLowerCase()) return;.

4. Please confirm the web /transition page still signs in on a cold load

LogInWithShortLivedAuthTokenPage now returns early until LAST_VISITED_PATH hydrates, which also defers the account?.isLoading read. clearStorageAndRedirect sets ACCOUNT.isLoading = true and preserves ACCOUNT across a SAML re-auth. Before this change the effect ran before ACCOUNT hydrated and saw undefined; now it may see the persisted isLoading: true, skip the if (token && !account?.isLoading) branch, and — since the deps are only [route, isLoadingLastVisitedPath], neither of which changes afterwards — never retry. That's a permanent spinner on /transition.

I could not reproduce this (no SAML domain account), so treat it as a question, not a defect. Worth a hard reload on the IdP return URL.

The whole gate goes away if signInWithShortLivedAuthToken reads LAST_VISITED_PATH itself — it already keeps module-level Onyx.connect state for session and credentials. That also drops the [route, isLoadingLastVisitedPath] deps, whose // The only dependencies of the effect are based on props.route comment is now inaccurate.

Smaller notes
  • handleExitToNavigation already does waitForUserSignIn → waitForProtectedRoutes → navigate to exitTo. The new block duplicates it with resetRoot instead of goBack + navigate. Consider one helper with a "rebuild the stack" option.
  • On web, Navigation.navigate(ROUTES.HOME, {forceReplace: true}) still fires right after the sign-in call, so the user sees Home before resetRoot lands. It resolves in the right order today (isNavigationReady beats waitForProtectedRoutes), but skipping the Home hop when exitTo is set would remove the flash and the ordering dependency.
  • saveCurrentPathBeforeBackground is now exported solely for tests/unit/LastVisitedPathOnBackgroundTest.ts. Fine, just noting it widens the public surface of App.ts.
  • Test coverage gap: nothing covers the authenticated gate in parseAndLogRoute, which is the other half of the fix. EXCLUDE_FROM_LAST_VISITED_PATH and the SignInRedirect behavior are both covered well.
  • SCREENS.TRANSITION_BETWEEN_APPS is 'TransitionBetweenApps', so the runtimeConfigured.ts / runtimeDefaults.ts pair stays in sync. ✅
On the two open questions in the thread

iOS back from Profile going to Home. resetRoot with the adapted state should be byte-identical to what NavigationRoot's initialState builds on a cold start, since both call getAdaptedStateFromPath with the same path. allgandalf's suggestion is the right test: if a cold launch restored onto Profile also goes back to Home, it's pre-existing and out of scope here.

Android still landing on Home. dd4f9ac closes the write path you were hitting — saveCurrentPathBeforeBackground now bails when there's no authToken, so the Chrome custom tab backgrounding the app can no longer stamp /inbox over the kept path. If it still fails on that commit, the interesting signal is whether LAST_VISITED_PATH survives to the moment SAMLSignInPage reads it, or whether it survives but resetRoot never runs — items 1 and 4 above are both silent-failure modes that look identical from the outside.

I did not run the test suite (sandbox restrictions) and did not device-test, since the flow needs a SAML-required domain account.


Reply with @MelvinBot <feedback> to dig into any of these.

@allgandalf

allgandalf commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor Author

it worked for me :

Screen.Recording.2026-09-10.at.11.28.26.AM.mov

Slack chat b/w @huult and me for possible problem they are not able to test:

what is the RAM on your emulator  ? (edited) 
[11:29 AM]it worked for me #100475 (comment)
[11:30 AM]chrome exhausts a lot of RAM for the emulator so it crashes in between validation and you get logged out > completely, so you land on home
[11:30 AM]try expanding your emulator ram and it should work correctly
[11:30 AM]else i verified it works on android so i think it's just fine

@huult

huult commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

it worked for me :

Screen.Recording.2026-09-10.at.11.28.26.AM.mov
Slack chat b/w @huult and me for possible problem they are not able to test:

what is the RAM on your emulator  ? (edited) 
[11:29 AM]it worked for me #100475 (comment)
[11:30 AM]chrome exhausts a lot of RAM for the emulator so it crashes in between validation and you get logged out > completely, so you land on home
[11:30 AM]try expanding your emulator ram and it should work correctly
[11:30 AM]else i verified it works on android so i think it's just fine

Screen.Recording.2026-09-10.at.14.29.48.mov

@allgandalf I tried again, but it’s still not working on my side. As we discussed on Slack, since you confirmed that it works well on both the emulator and your real device, I think we can merge this PR since I’ve already completed testing on both iOS and Web. Could you help verify the Android side one more time and share the results here so I can approve it?

@allgandalf

Copy link
Copy Markdown
Contributor Author

@huult android LGTM, how did ios and web go ?

@huult

huult commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

@huult android LGTM, how did ios and web go ?

Screen.Recording.2026-09-10.at.14.38.30.mov
Screen.Recording.2026-09-10.at.14.50.36.mov

It works

@huult huult left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@melvin-bot melvin-bot Bot changed the title Keep the page across a forced SAML re-auth [Payment due @huult] Keep the page across a forced SAML re-auth Sep 10, 2026
@melvin-bot

melvin-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

🎯 @huult, thanks for reviewing and testing this PR! 🎉

A payment issue will be created for your review once this PR is deployed to production.
E/E issue linked to the PR - https://www.github.com/Expensify/Expensify/issues/674363.

If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created.

@allgandalf

Copy link
Copy Markdown
Contributor Author

@mountiny can you try getting this merged before the next deploy?

@mountiny mountiny added the InternalQA This pull request required internal QA label Sep 10, 2026

@mountiny mountiny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for thorough testing, lets watch out for any issues in staging

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB: Tests should follow the Given, When, Then comments

@mountiny
mountiny merged commit 186ca6c into Expensify:main Sep 10, 2026
37 of 39 checks passed
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.76-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Help site review: one article needs an update.

Draft PR: #100897 (HelpDot, assigned to you)

What I changed and why

This PR adds no setting, screen, or button, so no existing article became wrong. But it does change behavior members already complain about — the linked report describes the screen flashing to the sign-in page mid-session and filters resetting — and the help site never documented that behavior at all. Troubleshoot-SAML-SSO-Login.md is the article people land on for exactly this symptom, so I added it there:

  • New section Why SAML SSO sign-in restarts while you are working — what triggers the re-auth, what members see, that they now return to the page and filters they were on, that a manual sign out starts on Home instead, and the offline case from your Offline tests.
  • New FAQ entry Do I lose my place when SAML SSO signs me back in?
  • Frontmatter keywords extended with session expired, signed out while working, re-authentication.

I did not touch Set-Up-SAML-SSO.md or any Expensify Classic article — the fix is NewDot only.

Two things worth your eye when you review

Filters. The new copy says members return to the page "with the filters you had applied still in place." I took that from your test steps, which note the filtered Reports URL comes back. When I checked the live app, the applied filter on the expenses list did not show up in the browser URL, so if filter state does not travel in the path this restores, that sentence needs to soften to "the page you were on." Worth confirming against a real SAML domain.

No interval stated. Your description says every 2h. I wrote "from time to time" instead, since I could not verify the interval from a public source. Say the word if you want the real number in there.

Terminology checked against the live app: Home is the tab the app lands on after sign-in (tabs are Home, Inbox, Spend, Workspaces, Account). Require SAML login matches the exact string in src/languages/en.ts. Written against HELPSITE_NAMING_CONVENTIONS.md, HELP_AUTHORING_GUIDELINES.md, and TEMPLATE.md — task-based headings, #/## only, no Liquid includes or collapsible sections.

@allgandalf, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/mountiny in version: 9.4.76-1 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@melvin-bot

melvin-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown

🤖 Payment issue created: #100998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

InternalQA This pull request required internal QA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants