-
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
Ask non-USD Workspaces to update currency before adding VBBA #19638
Conversation
@rushatgabhane @thienlnam One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@rushatgabhane Will you be able to complete the checklist on this one or should we ask some other C+? |
@mountiny I'll be able to complete it |
This is a race condition between
@thienlnam @mountiny would love your thoughts on the above solutions |
We're run into a similar situation where we're navigating to a page and the onyx data hasn't been set yet. Creating a new room and immediately navigating to it. What we ended up doing was using onyx.set for the items we needed for navigation bc it was much faster, would that be possible here as well? |
Is what Jack proposed possible here? Otherwise I feel like if new command works for this then it could be a way to go. It matches the 1:1:1 strategy |
Now that I'm thinking more about it, I'm not sure if the issue @rushatgabhane is seeing is a race condition. I'll try to reproduce it on my end to investigate. |
So it does seem to be an Onyx race condition. I updated |
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
cc: @mountiny
We did not find an internal engineer to review this PR, trying to assign a random engineer to #16744... Please reach out for help on Slack if no one gets assigned! |
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.
One change requested, otherwise LGTM
@mountiny updated! |
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, sending it!
Jk, can't need Vit to re-approve |
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 everyone!
✋ 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 https://github.com/mountiny in version: 1.3.30-0 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.30-5 🚀
|
if (this.state.shouldShowContinueSetupButton) { | ||
return ( | ||
<ContinueBankAccountSetup | ||
reimbursementAccount={this.props.reimbursementAccount} | ||
continue={this.continue} | ||
policyName={policyName} | ||
/> |
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.
cc @luacmartins, This block is duplicated now, check line 384 ,we intentionally changed the order of rendering in this PR #20406.
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.
ah nice catch. Do we have a PR to fix this already?
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.
No we don't have a PR yet, needed to confirm before moving forward. I will create a PR.
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.
PR is ready : #22253
<Text>{this.props.translate('bankAccount.hasBeenThrottledError')}</Text> | ||
</View> | ||
); | ||
const hasUnsupportedCurrency = lodashGet(this.props.policy, 'outputCurrency', '') !== CONST.CURRENCY.USD; |
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.
This line caused an edge case regression, when the policy is empty (deleted from other device) it will display the CurrencyError
, we fixed that by displaying FullPageNotFoundView
when policy is deleted.
@@ -512,9 +512,12 @@ function clearAvatarErrors(policyID) { | |||
function updateGeneralSettings(policyID, name, currency) { | |||
const optimisticData = [ | |||
{ | |||
onyxMethod: Onyx.METHOD.MERGE, | |||
// We use SET because it's faster than merge and avoids a race condition when setting the currency and navigating the user to the Bank account page in confirmCurrencyChangeAndHideModal | |||
onyxMethod: Onyx.METHOD.SET, |
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.
Coming from #37254 (comment)
Because we're using Onyx.set
, we should have spread the old pendingFields.
Details
Part 1 of 2 from #16744
Here we'll start preventing users from initiating/completing the VBBA flow if their Workspace currency is different than USD.
Fixed Issues
$ #16744
Tests
Settings > Workspace > Settings > Default Currency
AED
Settings > Workspace > Bank account
Cancel
Bank account
again and verify that the modal opens againUpdate to USD
Connect bank account
pageSettings > Workspace > Settings > Default Currency
USD
AED
againSteps below are for Web only:
9283AFFC0378797B
inworkspace/9283AFFC0378797B/settings
/bank-account/CompanyStep?policyID=<Workspace id>
, replacing<Workspace id>
with the value copied in step 14Oops! It appears that your workspace currency is set to a different currency than USD. To proceed, please set it to USD and try again
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
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)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
web.mov
Mobile Web - Chrome
chrome.mov
Mobile Web - Safari
safari.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov