Stop a client-side session age check from signing users out and dropping GPS trips - #97787
Stop a client-side session age check from signing users out and dropping GPS trips#97787allgandalf wants to merge 23 commits into
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@Eskalifer1 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] |
|
This PR adds a new |
|
LMK if you need my help here! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08fac85824
ℹ️ 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".
GCyganek
left a comment
There was a problem hiding this comment.
Added one comment, other than that it looks good 👍 I tested GPS flows and they seem to be working fine
@Eskalifer1 do you have SAML enabled ? |
No, i don't. Is there any way to setup it? |
not that i know off, you need a private domain, be domain admin and SAML enabled :_; |
|
Oh, okay. Feel free to reassign this, thank you for quich answer! |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product
|
conflicts |
# Conflicts: # tests/actions/SessionTest.ts
|
Thanks for updating that @allgandalf @Eskalifer1 What is your ETA for reviewing and testing this PR? |
|
Hi @mountiny, i don't have SAML enabled, i have asked here(#97787 (comment)) to reassign |
|
Ah right @allgandalf I am not sure if contributors can test this, their saml login will take them to production, right? |
Correct! Not really sure what is the best way here |
|
maybe, lets production QA this then ? |
Explanation of Change
isExpiredSessionis a 2 hour client-side check onsession.creationDatethat never looks at whether the token is actually valid. On a SAML account it sendsreauthenticate()straight toredirectToSignIn, and theOnyx.clearthere wipes the in-progress GPS trip. Attachment images now keep serving the token we already have when a background refresh is not possible, and a live trip survives the forced re-auth, owner-checked so another user can never resume it.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/665676
$ #92435
PROPOSAL: n/a
Tests
Both halves need an account that cannot silently reauthenticate, i.e. SAML required. On a normal account
reauthenticate()succeeds in the background, so nothing here changes.Attachment images:
session.creationDatemore than 2 hours into the past. Leave the auth token untouched, it is still valid.GPS trip, on iOS or Android:
5. Start a distance expense, pick the GPS tab and start a trip, then let it record some distance.
6. Go to Settings > Troubleshoot > Authentication status, tap
Invalidate with delayand wait ~15 seconds. Test tools are hidden on production, so use dev or staging.7. Complete the SAML sign in as the same user.
8. Verify the
Continue GPS trip recording?prompt appears and thatContinue tripresumes with the earlier distance intact.9. Repeat steps 5 and 6, then cancel the IdP browser when it opens and sign in as a different user.
10. Verify no trip prompt appears and the previous user's route is not shown.
Offline tests
QA Steps
Same as tests.
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.Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-08-12.at.15.17.37.mov