Prevent OD api calls during SSO sign out#83440
Conversation
|
|
JmillsExpensify
left a comment
There was a problem hiding this comment.
Not a PR requiring product review.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ab3e691ac
ℹ️ 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".
src/libs/actions/Session/index.ts
Outdated
| const isSupportal = isSupportAuthToken(); | ||
| const shouldRestoreStashedSession = isSupportal || shouldForceUseStashedSession; | ||
|
|
||
| CONFIG.IS_HYBRID_APP && shouldSignOutFromOldDot && HybridAppModule.startSignOut(); |
There was a problem hiding this comment.
Revert sign-out guard when logout request fails
startSignOut() is now triggered before the logout request, but rollback is only wired for the SAML browser-cancel path; if the later LOG_OUT call rejects (for example on network failure), control goes to the existing terminal .catch(...) and neither signOutFromOldDot() nor cancelSignOut() runs. In hybrid mode that can leave OldDot stuck in a “sign-out started” state, which blocks OD API traffic beyond this logout attempt. Please ensure all logout failure paths clear the started flag.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is clean Mobile-Expensify when signOutFromOldDot is called
|
@jnowakow It's my first time reviewing a |
|
@jjcoffee there are no stupid questions! If you want to build and test it locally you should just checkout to this branch in App repo and then go to Mobile-Expensify and checkout there to the corresponding branch. In this case branches have the same names so it will be: cd App
git checkout jnowakow/prevent-old-dot-calls-during-sign-out
cd Mobile-Expensify
git checkout jnowakow/prevent-old-dot-calls-during-sign-outNow if you will build the app it have required changes both in OldDot and NewDot :D If you want to test it with AdHoc builds you can just trigger it. Since I've linked corresponding PR with If testing goes well we have to merge two PRs in more or less the same time in order to deploy both changes in next release :D |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid-app-2026-02-27_19.00.42.mp4Android: mWeb ChromeiOS: HybridAppios-app-2026-02-27_17.18.55.mp4iOS: mWeb SafariMacOS: Chrome / Safari |
|
@jnowakow Thanks! Do you know if there's a way to test the SSO sign-in? I don't have a private domain I can use. |
|
@jjcoffee I'm using Andrew's account that he set up for us. I'll send you the credentials on Slack :D |
This comment was marked as resolved.
This comment was marked as resolved.
jjcoffee
left a comment
There was a problem hiding this comment.
LGTM! Tests well on native. We need to merge the Mobile-Expensify PR at the same time as this one. cc @AndrewGable
|
@AndrewGable Friendly bump to review this and the |
|
@AndrewGable can you take a look at this PR, please 🙏 |
|
Holding on merging until Mobile-Expensify pr is mergable |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @AndrewGable 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/AndrewGable in version: 9.3.41-0 🚀
Bundle Size Analysis (Sentry): |
|
Deploy Blocker #85937 was identified to be related to this PR. |
|
This PR failing because of the issue #85937 |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.41-4 🚀
|
@AndrewGable
Explanation of Change
When user is signed in via SSO during sign out the browser is opened. This puts App in the background and brings in again in foreground when browser closes. It caused OldDot to perform API calls even though authTokens was removed in the meantime. This is turn started reauthentication flow showing the browser again. Now ND informs OD that signout was started preventing any calls when app is brought to foreground.
Fixed Issues
$ #83056
PROPOSAL: N/A
MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/13872
Tests
Offline tests
N/A
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
2.mov
Android: mWeb Chrome
iOS: Native
ios.mov
iOS: mWeb Safari
MacOS: Chrome / Safari