Repository navigation
[Payment due @huult] Keep the page across a forced SAML re-auth - #100475
Conversation
There was a problem hiding this comment.
💡 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".
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-09-10.at.14.38.30.moviOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-09-10.at.14.50.36.mov |
Screen.Recording.2026-09-08.at.10.27.22.movBUG: After re-authentication, the profile is redirected to Home instead of the Account tab. |
Screen.Recording.2026-09-08.at.10.39.41.movBUG: After re-authentication, the app redirects to Home.
|
@allgandalf Could you try simulating this case? We might end up saving the last visited path with a token, which we don't want. |
Screen.Recording.2026-09-08.at.10.57.08.movBUG: Redirects to Inbox instead of the Inbox chat
|
Screen.Recording.2026-09-08.at.11.24.17.mov@allgandalf It’s not working on web. |
good catch, the go back after landing was popping the page 4s later. fixed in fcd2e36
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
good call, the transition screen is excluded from lastVisitedPath now, test in bcb39ce
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
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 ?
Oh i actually see you're on new.expensify.com and not dev, can you please check 😅 |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
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
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
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 |
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? |
|
@MelvinBot review |
|
🤖 Code review of the current branch ( 1.
|
|
it worked for me : Screen.Recording.2026-09-10.at.11.28.26.AM.movSlack chat b/w @huult and me for possible problem they are not able to test:
|
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? |
|
@huult android LGTM, how did ios and web go ? |
Screen.Recording.2026-09-10.at.14.38.30.movScreen.Recording.2026-09-10.at.14.50.36.movIt works |
|
🎯 @huult, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. 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. |
|
@mountiny can you try getting this merged before the next deploy? |
mountiny
left a comment
There was a problem hiding this comment.
Thanks for thorough testing, lets watch out for any issues in staging
There was a problem hiding this comment.
NAB: Tests should follow the Given, When, Then comments
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.76-0 🚀
|
|
🤖 Help site review: one article needs an update. Draft PR: #100897 ( 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.
I did not touch Two things worth your eye when you reviewFilters. 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 @allgandalf, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.4.76-1 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Payment issue created: #100998 |

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.
Offline tests
QA Steps
Same as tests, on an account whose domain has SAML required.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari