Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
- Login to Account A.
- Navigate to account settings and close the account.
- After being redirected back to the login page, log in to other account - Account B.
- Access Account B's email inbox and open the email containing the "magic sign-in link."
- Click on the sign-in link > This action should open the app.
(we must login via attached link in the email) - Observer: Unable to login to account B, the app gets stuck loading
Expected Result:
The user should be able to log in without any issue
Actual Result:
Unable to log in after closing an account. Users have to un-install and re-install app to login again
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- Android / native
- Android / Chrome
- iOS / native
- iOS / Safari
- MacOS / Chrome / Safari
- MacOS / Desktop
Version Number: 1.3.56-19
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Unable-to-login-via-link-22.August.MP4
0-02-01-e1e1c5a4ee2f11b58890a84aad38529ae4a3104fc1ed9626c48c4ac8a393a8f8_ab92111009d31f2a.1.mp4
Expensify/Expensify Issue URL:
Issue reported by:@tranvantoan-qn
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691850473918269
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~012f681206489deb34
- Upwork Job ID: 1695137778067378176
- Last Price Increase: 2023-08-25
- Automatic offers:
- jjcoffee | Reviewer | 26375721
- b4s36t4 | Contributor | 26375723
Activity
melvin-bot commentedon Aug 23, 2023
Triggered auto assignment to @NicMendonca (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Aug 23, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)tranvantoan-qn commentedon Aug 23, 2023
Please note that the steps 4 and 5 are key (the issue won't happen if we login again by entering the Magic Code directly)
NicMendonca commentedon Aug 23, 2023
@tranvantoan-qn as opposed to?
tranvantoan-qn commentedon Aug 23, 2023
@NicMendonca ah, it is just a note to make sure you are not reproducing the issue that way
b4s36t4 commentedon Aug 24, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Log in - Unable to login after Closing an account
What is the root cause of that problem?
The infinite login is because of this line
App/src/libs/Navigation/AppNavigator/AuthScreens.js
Line 129 in aa98b6b
Here we listen for application state weather it is inactive or active or in background, because of this line when ever we leave the application for magic code app becomes inactive, when we visit the app again via deeplink this callback will get called.
And since the we use persisted network and the way we designed it always calling the
reconnectAppbecausereconnectAppis the first in the queue. And because we're not authenticated this request will give407code which causes infinite network request which madeSigninUserWithLinkcommand to not execute which causing the loader to be shown here.And the reason the above
onReconnectcallback would execute is the main RCA here which involves the issue above I said.We've added this listener in
AuthScreenscomponent which will only render if we're authenticated once we're logged in and signout we removed the listener here in this lineApp/src/libs/actions/SignInRedirect.js
Line 88 in 01fc928
But this won't happen in case of
Closingthe account, because of the listener still active because we're loggedin this listener will be active when we click on close account even though we're not part ofAuthScreenscomponent anymore listener is still active this causing the issue when we leave the app to callreconnectAppcommand to go on top of the queue.What changes do you think we should make in order to solve the problem?
We can solve this two ways
Call
Network.clearReconnectionCallbacksinUser.jsatcloseAccountfunctionCall
Network.clearReconnectionCallbacksfunction hereApp/src/libs/Navigation/AppNavigator/AuthScreens.js
Line 201 in aa98b6b
componentWillUnmountfunctionWhat alternative solutions did you explore? (Optional)
NA
b4s36t4 commentedon Aug 24, 2023
Result for #25793 (comment)
Kapture.2023-08-24.at.22.41.10.mp4
NicMendonca commentedon Aug 24, 2023
I am failing to see how this is not an edge case. Without SAML, you can only log in with a magic code, and it is very unlikely a user is going to have two accounts, and try to follow these steps on iOS native specifically. I am going to close this for now.
b4s36t4 commentedon Aug 24, 2023
@NicMendonca it doesn't have to be different accounts and I don't feel this can be closed.
You can follow these below steps to re-produce this.
Once we close the account and after re-directing to signin page again after that if we move app to the background user won't be able to login anymore. Doesn't have to be different account.
If you want I can make a clear video on how to re-produce this.
tranvantoan-qn commentedon Aug 24, 2023
@NicMendonca
This one is critical and should not be close:
other accountin the step because there might be the case you was using .expensifal, after closing it, you wont be able to re-login with errorcan not get account detailsbefore enter magic code screen)b4s36t4 commentedon Aug 24, 2023
Yes, I agree with @tranvantoan-qn I have witnessed it.
40 remaining items
melvin-bot commentedon Sep 13, 2023
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:
tranvantoan-qn commentedon Sep 13, 2023
I'm waiting the offer for Reporter Role
jjcoffee commentedon Sep 18, 2023
closeAccountNicMendonca commentedon Sep 20, 2023
@tranvantoan-qn Please apply to the job: https://www.upwork.com/jobs/~012f681206489deb34
tranvantoan-qn commentedon Sep 20, 2023
Thank you! I've applied for the job
NicMendonca commentedon Sep 20, 2023
jjcoffee commentedon Sep 20, 2023
@NicMendonca I think you've miscalculated the timeliness bonus? Should be $250 now 😄
b4s36t4 commentedon Sep 20, 2023
I have seen same kind of calculations 😅 in some other issues. Maybe bonus is 100%??
b4s36t4 commentedon Sep 20, 2023
I have received in amount in my account 😄.
NicMendonca commentedon Sep 20, 2023
😬 Opps. I added a $500 (50%) bonus, forgetting this was changed to $500 (down from $1000).
I will make note of this for next time 🙇♀️
b4s36t4 commentedon Sep 20, 2023
Hey, @NicMendonca What about the extra amount received? any way to revert?
NicMendonca commentedon Sep 20, 2023
@b4s36t4 unfortunately no! But appreciate your honestly lol