-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Allow e.com to link straight to e.cash and share sessions #3715
Conversation
This is all working, but the redirect to the new-workspace page is causing several JS console warnings: They don't appear to be affecting anything, but I haven't been able to figure out what the deal is. My guess is that it's related to running these back-to-back:
and I think there is a race condition because I think part of the code inside I'm not sure what to do about this. We need to have this code deployed by Jul 9, so I am thinking that we merge this as-is, and then open up an issue for improving this dismiss->navigate pattern. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes LGTM! I'm not sure whether there is any problem with the dismiss + navigate pattern (it seems kosher to me). But I agree that the react warning is not a blocker. Could be an issue is withOnyx()
not having any awareness that its children have unmounted - I've observed similar issues before, but hard to say without debugging.
if (this.props.session.authToken) { | ||
// In order to navigate to a modal, we first have to dismiss the current modal. But there is no current | ||
// modal you say? I know, it confuses me too. Without dismissing the current modal, if they user cancels | ||
// out of the new workspace modal, then they will be routed back to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But there is no current modal you say? I know, it confuses me too.
NAB, I can see how this could be confusing (because the modal is not visible), but I think maybe it's not that mysterious. Curious if we should replace this commentary with a better explanation and have an idea about what's happening here...
ValidateLogin2FANewWorkspacePage is the modal we are dismissing, it "exists", but the page is returning null
. So that's why we need to remove it from the history stack or else when we "goBack()" we will navigate to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm all in favor of updating this comment to make more sense. If the real problem is that ValidateLogin2FANewWorkspacePage
is in the history stack, maybe there is a better way for us to remove it from the stack without needing to call dismissModal()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe there is a better way for us to remove it from the stack without needing to call dismissModal()
I'm having trouble working out a better way. It feels like there are contexts where you'd want the default navigate()
method to preserve the underlying modal in the stack e.g. moving from /settings
to /settings/payments
and contexts where you'll want a different behavior. We could maybe add a parameter to navigate()
that forces all other modals to close?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All right, I was able to fix this. Turns out, I was navigating to that modal twice (once in Session, and again from ComponentDidMount (from when the same page was remounted: once in public screens
and then again in auth screens
).
Once I removed the navigation in the Session action, it all worked like a charm.
I removed the hold because this actually needs to be deployed first, before the web-e change. |
All right, thanks for the reviews! I updated it and addressed everything as well as fixing the initial warnings that I was struggling with. Should be ready for another review. |
* @param {String} parameters.accountID | ||
* @param {String} parameters.validateCode | ||
* @param {String} [parameters.twoFactorAuthCode] | ||
* @returns {Promise<unknown>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB / just curious but why Promise<unknown>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think PHPStorm did that automatically, so I'm not sure why! I'll remove it
}, | ||
headerShown: false, | ||
animationTypeForReplace: 'pop', | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like defaultScreenOptions
is also declared in PublicScreens.js
with the same values. Maybe they should be moved into a separate config file so we don't have to remember to update things twice in the future when applying a change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can do that.
Updated to DRY up the default screen options. |
I'm trying to test this out, and Web-E redirects me to the correct link, but then I am redirect to the homepage without any error messages. Is there any additional setup I have to do that is not mentioned in the testing steps? |
@alex-mechler I don't think there is anything special you need to do, no. Just so I am clear, the test steps work for except that instead of seeing the new-workspace page, you see the home page? |
Correct. I am not automatically logged into e.cash, and do not see the new workspace page. I checked out the branch from https://github.com/Expensify/Web-Expensify/pull/31302 and this branch. Is there any other branches I need to checkout? Was there any auth changes that I might be missing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out my auth was out of date 😅
Works well, two NABs, feel free to merge if you don't think they are worth fixing
src/languages/en.js
Outdated
@@ -268,6 +268,7 @@ export default { | |||
}, | |||
passwordForm: { | |||
pleaseFillOutAllFields: 'Please fill out all fields', | |||
enterATwoFactorAuthenticationCodeToContinue: 'Enter a two factor authentication code to continue', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB: I feel like your
reads better than a
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I can change this.
success | ||
style={[styles.mb2]} | ||
text={this.props.translate('common.continue')} | ||
isLoading={this.state.loading} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB: We never set this anywhere but the constructor, meaning the user has no feedback as to when we are actually loading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll see about cleaning this up.
OK, I updated to change the language on the form prompt and to display the loading indicator when the 2FA is being validated. |
I'm gonna go ahead and merge since the other reviewers approved already and the changes since then were minor. |
Once this goes to production, we can merge Expensify/Web-Expensify#31302 |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
User is not automatically logged into e.cash after completing the inbox taskExpected Result:Scenario 1: Verify that you are automatically logged into e.cash and are seeing the page to create a new workspace Actual Result:Not automatically logged into e.cash and the page to create a new workspace isn't shown. User is redirected to sign in page for both the scenarios Actions Performed:Scenario1:
Scenario2:
Platform:Web ✔️ Build:1.0.77-0 Notes/Images/Video: |
Ah, I think that's expected for now. Sorry, this issue should be production QA and internal QA (because it requires being in a beta for it to work). It also needs to have https://github.com/Expensify/Web-Expensify/pull/31302 deployed, and it looks like that still hasn't been. |
Perfect! will check the PR off the list then. Thanks 🙇 |
🚀 Deployed to production in version: 1.0.77-5🚀
|
Yeah! Noice
…On Thu, Jul 15, 2021 at 12:09 PM Amal Nazeem ***@***.***> wrote:
ITS WORKING!!
I got redirected from expensify after gettting the new task
[image: image]
<https://user-images.githubusercontent.com/19364431/125834154-2c196589-a829-4269-8d6b-f7fcf87e99f6.png>
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#3715 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJMAB2LEGKRHYBFGDHV7O3TX4P4NANCNFSM47CSENHA>
.
|
Fixed Issues
Done along with: https://github.com/Expensify/Web-Expensify/pull/31302
Fixes https://github.com/Expensify/Expensify/issues/162554
Tests / QA
Now, test it out with 2FA
Tested On
No other platforms need to be tested because this flow only works on web (the inbox task isn't shown on mobile at all)
Screenshots
Web
cc @marcaaron @TomatoToaster