You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-02-05] [$500] SignInWithShortLivedAuthToken sometimes gets called in a loop #33413
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2InternalRequires API changes or must be handled by Expensify staff
changed the title [-]SignInWithShortLivedAuthToken sometimes gets called in a loop[/-][+][$500] SignInWithShortLivedAuthToken sometimes gets called in a loop[/+]on Dec 21, 2023
so signInWithShortLivedAuthToken can be called repeatedly and redundant requests can be sent to the server if for e.g the useEffect is called repeatedly with a change of dependency.
What changes do you think we should make in order to solve the problem?
We should call signInWithShortLivedAuthToken after checking account.isLoading is false everywhere we are using it to avoid requesting in a loop
@flodnv Is there a particular action showing on your end where this loop happens? I've tried opening a WS from OD while ND is logged out and while it's logged in with a different user and I'm seeing only one SignInWithShortLivedAuthToken call being made
changed the title [-] [$500] SignInWithShortLivedAuthToken sometimes gets called in a loop[/-][+][HOLD for payment 2024-02-05] [$500] SignInWithShortLivedAuthToken sometimes gets called in a loop[/+]on Jan 29, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.32-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@Santhosh-Sellavel] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: GH discussion
[@Santhosh-Sellavel] Determine if we should create a regression test for this bug. 👎
[@Santhosh-Sellavel] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again. 👎
[@kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Instead of adding regressions tests we are probably going to add rate limiting to this endpoint to prevent this in the future. Checklist should be all set @kadiealexander@Santhosh-Sellavel
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2InternalRequires API changes or must be handled by Expensify staff
Activity
melvin-bot commentedon Dec 21, 2023
Triggered auto assignment to @kadiealexander (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Dec 21, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)[-]SignInWithShortLivedAuthToken sometimes gets called in a loop[/-][+][$500] SignInWithShortLivedAuthToken sometimes gets called in a loop[/+]melvin-bot commentedon Dec 21, 2023
Job added to Upwork: https://www.upwork.com/jobs/~0127bcdf935f2ba4af
melvin-bot commentedon Dec 21, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel (
External)FitseTLT commentedon Dec 21, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
SignInWithShortLivedAuthToken sometimes gets called in a loop
What is the root cause of that problem?
Inside
signInWithShortLivedAuthTokenwe setisLoadingof the account to true in the optimistic data hereApp/src/libs/actions/Session/index.ts
Lines 333 to 342 in 2f7c2b2
but there are places where we have called
signInWithShortLivedAuthTokenwithout checkingaccount.isLoadingis falselike here
App/src/pages/LogOutPreviousUserPage.js
Line 54 in 2f7c2b2
so
signInWithShortLivedAuthTokencan be called repeatedly and redundant requests can be sent to the server if for e.g the useEffect is called repeatedly with a change of dependency.What changes do you think we should make in order to solve the problem?
We should call
signInWithShortLivedAuthTokenafter checkingaccount.isLoadingisfalseeverywhere we are using it to avoid requesting in a loopApp/src/pages/LogOutPreviousUserPage.js
Line 54 in 2f7c2b2
and also in here
App/src/pages/signin/SAMLSignInPage/index.native.js
Lines 47 to 48 in 2f7c2b2
as we did here
App/src/pages/LogInWithShortLivedAuthTokenPage.js
Lines 60 to 62 in 2f7c2b2
What alternative solutions did you explore? (Optional)
AmjedNazzal commentedon Dec 21, 2023
@flodnv Is there a particular action showing on your end where this loop happens? I've tried opening a WS from OD while ND is logged out and while it's logged in with a different user and I'm seeing only one

SignInWithShortLivedAuthTokencall being madeflodnv commentedon Dec 21, 2023
Honestly I'm not sure 😬
flodnv commentedon Dec 22, 2023
@Santhosh-Sellavel please let us know what you think about the proposal 🙇
69 remaining items
[-] [$500] SignInWithShortLivedAuthToken sometimes gets called in a loop[/-][+][HOLD for payment 2024-02-05] [$500] SignInWithShortLivedAuthToken sometimes gets called in a loop[/+]melvin-bot commentedon Jan 29, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jan 29, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.32-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-02-05. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jan 29, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
Santhosh-Sellavel commentedon Feb 2, 2024
@arosiclair Can you help me with the checklist here?
arosiclair commentedon Feb 5, 2024
Instead of adding regressions tests we are probably going to add rate limiting to this endpoint to prevent this in the future. Checklist should be all set @kadiealexander @Santhosh-Sellavel
melvin-bot commentedon Feb 5, 2024
Payment Summary
Upwork Job
BugZero Checklist (@kadiealexander)
kadiealexander commentedon Feb 7, 2024
Closing, please request your payment in NewDot Santhosh!
Santhosh-Sellavel commentedon Feb 10, 2024
Requested on ND
JmillsExpensify commentedon Feb 11, 2024
$500 approved for @Santhosh-Sellavel based on summary above.