You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2025-02-07] [$250] Subscription: Currency selected incorrectly after page reload #55569
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: 9.0.88-4 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: 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:@dukenv0307 Slack conversation (hyperlinked to channel name): expensify_bugs
Action Performed:
Go to Subscription page
Click Add payment card
Change currency to AUD
Reload page
Observe currency it has been reset to USD
Click on currency field
Expected Result:
USD option is selected
Actual Result:
AUD option is selected
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android: Standalone
Android: HybridApp
Android: mWeb Chrome
iOS: Standalone
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidencebug.movRecording.915.mp4
Please re-state the problem that we are trying to solve in this issue.
Currency selected incorrectly after page reload
What is the root cause of that problem?
Because we previously set the currency to AUD, when reloading, the debitCardFormhere still has the currency as AUD even though Onyx has updated it to USD.
We can do the same with pages that have similar problems.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Subscription: Currency selected incorrectly after page reload[/-][+][$250] Subscription: Currency selected incorrectly after page reload[/+]on Jan 22, 2025
@daledah's proposal looks good to me. To ensure that the previous state does not impact the rendering of the current page, we need to set initWithStoredValues to false
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.92-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@ikevin127 / @DylanDylann@dylanexpensify@ikevin127 / @DylanDylann The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A.
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition: Have at least one WS created in order to have the Subscription section show-up in Settings.
Go to Subscription page.
Click Add payment card (does not apply on Native [no support]).
Change currency to AUD (or any other than default USD).
Reload page (only applies to Web / mWeb and Desktop).
Verify that the currency will be reset to USD in both Add payment card and Change payment currency pages.
@drminh2807 Thanks for your explanation, your RCA explained why the cache is outdated. But I feel your solution is unsafe to me and It seems like workarounds @daledah Your proposal will make value in the currency page always the default @ikevin127 Your proposal looks good to me. A bit explained, because we return null when loading Onyx data, the cache should also be updated with the correct value when data is loaded. And we still can use cached value with the correct data
🎀 👀 🎀 C+ Reviewed
ikevin's solution is correct
but the RCA is unclear
Actually I think it was a fluke, because blocking the rendering of the entire form before the data was called, accidentally blocked CurrencyField from calling Form.clearError
I spent all day trying to figure out the RCA and help you guys identify the correct solution. Don't I deserve a reward? @neil-marcellini
We went with @ikevin127's solution and @DylanDylann was the C+ so they will be paid. @drminh2807 we definitely appreciate your help but I'm not sure it warrants payment unless there's some phrasing about this in our documentation I'm not aware of. I'll let @dylanexpensify make the final decision since he's in charge of payment.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Jan 21, 2025
Triggered auto assignment to @dylanexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.daledah commentedon Jan 21, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Currency selected incorrectly after page reload
What is the root cause of that problem?
Because we previously set the currency to AUD, when reloading, the
debitCardFormhere still has the currency as AUD even though Onyx has updated it to USD.App/src/pages/settings/PaymentCard/ChangeCurrency/index.tsx
Line 18 in 059368f
What changes do you think we should make in order to solve the problem?
we should add option
initWithStoredValuesasfalsesimilar to what we did elsewhereWe can do the same with pages that have similar problems.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
[-]Subscription: Currency selected incorrectly after page reload[/-][+][$250] Subscription: Currency selected incorrectly after page reload[/+]melvin-bot commentedon Jan 22, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021881985646640917256
melvin-bot commentedon Jan 22, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)DylanDylann commentedon Jan 22, 2025
@daledah's proposal looks good to me. To ensure that the previous state does not impact the rendering of the current page, we need to set initWithStoredValues to false🎀 👀 🎀 C+ Reviewed
melvin-bot commentedon Jan 22, 2025
Triggered auto assignment to @neil-marcellini, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
30 remaining items
melvin-bot commentedon Jan 31, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jan 31, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.92-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 2025-02-07. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jan 31, 2025
@ikevin127 / @DylanDylann @dylanexpensify @ikevin127 / @DylanDylann The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
ikevin127 commentedon Jan 31, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/43572/files#r1938168677.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A.
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition: Have at least one WS created in order to have the Subscription section show-up in Settings.
AUD(or any other than defaultUSD).USDin both Add payment card and Change payment currency pages.Do we agree 👍 or 👎.
DylanDylann commentedon Feb 1, 2025
@ikevin127 Thanks so much
drminh2807 commentedon Feb 3, 2025
ikevin's solution is correct
but the RCA is unclear
Actually I think it was a fluke, because blocking the rendering of the entire form before the data was called, accidentally blocked
CurrencyFieldfrom callingForm.clearErrorI spent all day trying to figure out the RCA and help you guys identify the correct solution. Don't I deserve a reward? @neil-marcellini
dylanexpensify commentedon Feb 5, 2025
coming up!
neil-marcellini commentedon Feb 6, 2025
We went with @ikevin127's solution and @DylanDylann was the C+ so they will be paid. @drminh2807 we definitely appreciate your help but I'm not sure it warrants payment unless there's some phrasing about this in our documentation I'm not aware of. I'll let @dylanexpensify make the final decision since he's in charge of payment.
dylanexpensify commentedon Feb 6, 2025
Payment summary:
Contributor: @ikevin127 $250 via Upwork
Contributor+: @DylanDylann $250 via Upwork
Please apply/request!
dylanexpensify commentedon Feb 7, 2025
All done!