-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HOLD for payment 2023-12-28] [$500] Workspace - Currencies do not load after transition from OldDot when other user logged in ND #31789
Comments
Job added to Upwork: https://www.upwork.com/jobs/~019bf54ae70b3509e1 |
Triggered auto assignment to @conorpendergrast ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Currency list is not loaded when transitioning from OldDot to NewDot with different account. What is the root cause of that problem?Currency list is loaded by App/src/libs/Navigation/AppNavigator/AuthScreens.js Lines 160 to 161 in a2fc32b
The problem is, upon transitioning to a new user, app is logging out: App/src/libs/Navigation/AppNavigator/AuthScreens.js Lines 164 to 167 in a2fc32b
then redirected to App/src/pages/LogInWithShortLivedAuthTokenPage.js Lines 60 to 63 in a2fc32b
In this state, user has logged in with the email from the transition, i.e. email from the URL params is the same as the session email, thus the app is treating it as a login from the same email. What changes do you think we should make in order to solve the problem?There needs to be a way of storing the previous session's email so that it can be compared accurately with the email from the new session.
/** The user's email of the previous session */
previousSessionEmail?: string;
function setPreviousSessionEmail(email: string) {
Onyx.merge(ONYXKEYS.SESSION, {previousSessionEmail: email});
}
if (shortLivedAuthToken && !props.account.isLoading) {
Session.setPreviousSessionEmail(props.session.email)
Session.signInWithShortLivedAuthToken(email, shortLivedAuthToken);
return;
}
const isTransitioningFromUser = SessionUtils.isLoggingInAsNewUser(currentUrl, session.previousSessionEmail);
const shouldGetAllData = isUsingMemoryOnlyKeys || SessionUtils.didUserLogInDuringSession() || isLoggingInAsNewUser || isTransitioningFromUser; What alternative solutions did you explore? (Optional)N/A |
Reproduced. Seems like it could be relatively rare in the real world, but we have plenty of customers with multiple user accounts! |
ProposalPlease re-state the problem that we are trying to solve in this issue.Workspace - Currencies do not load after transition from OldDot when other user logged in ND What is the root cause of that problem?The cause of this issue starts in this code: Lines 32 to 45 in a2fc32b
So in this code we are returning What changes do you think we should make in order to solve the problem?We can do the following:
signedInWithShortLivedAuthToken?: boolean;
function signInWithShortLivedAuthToken(email: string, authToken: string) {
const optimisticData: OnyxUpdate[] = [
.....
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.SESSION,
value: {
signedInWithShortLivedAuthToken: true,
},
},
];
const successData: OnyxUpdate[] = [
....
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.SESSION,
value: {
signedInWithShortLivedAuthToken: undefined,
},
},
];
Onyx.connect({
key: ONYXKEYS.SESSION,
callback: (session) => {
....
if (session?.signedInWithShortLivedAuthToken) {
loggedInDuringSession = true;
} ResultScreen.Recording.2023-11-24.at.12.41.21.PM.mov |
@cubuspl42, @conorpendergrast Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@cubuspl42, @conorpendergrast Huh... This is 4 days overdue. Who can take care of this? |
@cubuspl42 there are two proposals for your review here! |
C+ reviewed 🎀 👀 🎀 While both proposals sound fine, I prefer the solution by @AmjedNazzal. During the PR phase, I would suggest exploring whether the new introduced property ( |
Triggered auto assignment to @francoisl, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @cubuspl42 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @AmjedNazzal 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Thank you! offer accepted and PR will be up within a day. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.14-6 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 2023-12-28. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on 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:
|
@francoisl, @cubuspl42, @conorpendergrast, @AmjedNazzal Eep! 4 days overdue now. Issues have feelings too... |
1 similar comment
@francoisl, @cubuspl42, @conorpendergrast, @AmjedNazzal Eep! 4 days overdue now. Issues have feelings too... |
@conorpendergrast this is ready for payment. |
Triggered auto assignment to @sophiepintoraetz ( |
Adding another BZ member that can issue payment while Connor is OOO - cc @sophiepintoraetz Looks like this is ready for payment |
We did say that payments might be a little slower with the holidays but in any case, I have paid @AmjedNazzal - just waiting on @cubuspl42 to complete the checklist. |
|
@francoisl, @cubuspl42, @conorpendergrast, @sophiepintoraetz, @AmjedNazzal Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
This was caught by Applause during testing, so I think it's already captured under existing regression testing. I think it's likely we don't need a new test as a result, but if anyone disagrees, comment and let me know! Apart from that, we're all done here. Thanks! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.3-0
Reproducible in staging?: Y
Reproducible in production?: Y
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Action Performed:
Expected Result:
A list of all available currencies should be shown
Actual Result:
The list is empty, even the default currency is not shown
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6288641_1700751338403.2023-11-23_15-20-07.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @cubuspl42The text was updated successfully, but these errors were encountered: