-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Return response to fix signInWithShortLivedToken()
#8886
Conversation
Onyx.merge(ONYXKEYS.ACCOUNT, {success: true}); | ||
} else { | ||
const error = lodashGet(response, 'message', 'Unable to login.'); | ||
Onyx.merge(ONYXKEYS.ACCOUNT, {error}); |
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.
@aldo-expensify I'm just returning early now instead of setting the error again because it's already set here:
App/src/libs/actions/Session/index.js
Lines 199 to 202 in 411e59c
if (createLoginResponse.jsonCode !== 200) { | |
Onyx.merge(ONYXKEYS.ACCOUNT, {error: createLoginResponse.message}); | |
return; | |
} |
I think it's fine? The error message here is not translated anyway and doesn't provide much information so I think better to use the one from the server for now.
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 it is fine. The only remaining thing is to remove an unused import (lodash).
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.
Thanks!
Added reproduction steps in QA steps. |
Updated |
Very weird also not touching that file at all... |
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.
LGTM, just need to solve issue with lint.
@aldo-expensify looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
Not an emergency: merged the PR without the linter passing because:
In conclusion the linter was not making sense: #8886 (comment) and all the tests were passing |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @aldo-expensify in version: 1.1.58-0 🚀
|
🚀 Deployed to production by @AndrewGable in version: 1.1.60-3 🚀
|
Details
Related to @aldo-expensify's discovery in this comment -> #8865 (comment)
Tests
Not sure how to test this since I don't know what the reproduction is, but the code looks fine.
Test for regressions and make sure the
/transition
works correctly from OldDot > NewDotVerify that no errors appear in the JS console
PR Review Checklist
PR Reviewer Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followed/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)QA Steps
The objective is to get the url that takes us to NewDot with a short-lived token, then reuse it after a minute (the token expires after a minute)
Settings > Policies > Group
https://new.expensify.com/transition?accountID=XX&email=XXX&shortLivedToken=XXXXX
You will see an endless spinner in a white screen, but that is expected for now.
Screenshots
❌