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
[Due for payment 2025-02-27] [$250] Taxes - App crashes when trying to disable tax rate. #56158
Version Number: 9.0.93-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, repro on both If this was caught during regression testing, add the test name, ID and link from TestRail:#55192 Email or phone of affected tester (no customers):applausetester+bm456@applause.expensifail.com Issue reported by: Applause Internal Team Device used: Android and IOS App Component: Workspace Settings
Please re-state the problem that we are trying to solve in this issue.
App crashes
What is the root cause of that problem?
In native, after we reload the app and the first time we call setPolicyTaxesEnabled, allPolicies is undefined because the callback here isn't triggered before. So originalTaxes is an empty object
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)
NA
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.
Please re-state the problem that we are trying to solve in this issue.
App crashes when trying to disable tax rate after creating a new workspace.
What is the root cause of that problem?
This only happens when we open the tax rate page for the first time. No need to create a new workspace. When we toggle the tax, the policy here is undefined, so the taxes is undefined too.
It's undefined because allPolicies is also undefined. This all happens after #53852. In #53852, we enable inlineRequires, so this top level code is not immediately evaluated when we named import it.
It will only be evaluated when the imported function is called (doc). But when setPolicyTaxesEnabled is called, the onyx callback hasn't completed yet.
We can disable inline requires in WorkspaceTaxesPage, but that means other import inline requires are also disabled.
OR
Import TaxRate without any module.
import '@libs/actions/TaxRate'
OR
Create a file that contains the common onyx connection such as policy, import it like above in App.tsx and TaxRate can get the all policies data from that file. or we can get the policy data from PolicyUtils
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
changed the title [-]Taxes - App crashes when trying to disable tax rate.[/-][+][$250] Taxes - App crashes when trying to disable tax rate.[/+]on Feb 11, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.1-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@parasharrajat@abekkala@parasharrajat 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.
[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.
Activity
melvin-bot commentedon Jan 31, 2025
Triggered auto assignment to @abekkala (
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.nkdengineer commentedon Feb 3, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
App crashes
What is the root cause of that problem?
In native, after we reload the app and the first time we call
setPolicyTaxesEnabled,allPoliciesisundefinedbecause the callback here isn't triggered before. SooriginalTaxesis an empty objectApp/src/libs/actions/TaxRate.ts
Line 212 in f60c647
Then the app crashes here
App/src/libs/actions/TaxRate.ts
Line 256 in f60c647
What changes do you think we should make in order to solve the problem?
We should get the
isDisabledsaferApp/src/libs/actions/TaxRate.ts
Line 256 in f60c647
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)
NA
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.
melvin-bot commentedon Feb 4, 2025
@abekkala Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Feb 6, 2025
@abekkala Huh... This is 4 days overdue. Who can take care of this?
melvin-bot commentedon Feb 10, 2025
@abekkala Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
bernhardoj commentedon Feb 11, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
App crashes when trying to disable tax rate after creating a new workspace.
What is the root cause of that problem?
This only happens when we open the tax rate page for the first time. No need to create a new workspace. When we toggle the tax, the policy here is undefined, so the taxes is undefined too.
App/src/libs/actions/TaxRate.ts
Lines 210 to 213 in 48520ec
So, when we try to access the tax
isDisabledhere, it will crash.App/src/libs/actions/TaxRate.ts
Line 256 in 48520ec
It's undefined because
allPoliciesis also undefined. This all happens after #53852. In #53852, we enableinlineRequires, so this top level code is not immediately evaluated when we named import it.App/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx
Line 31 in 48520ec
App/src/libs/actions/TaxRate.ts
Lines 28 to 33 in 48520ec
It will only be evaluated when the imported function is called (doc). But when
setPolicyTaxesEnabledis called, the onyx callback hasn't completed yet.App/src/libs/actions/TaxRate.ts
Lines 210 to 211 in 48520ec
This is one of the pitfall described on the doc linked above.
What changes do you think we should make in order to solve the problem?
We have a few options.
First, instead of relying the policy data from Onyx.connect, we can pass the policy from the component because it's already available anyway.
Then pass the policy from the component.
App/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx
Line 121 in 48520ec
OR
We can disable inline requires in WorkspaceTaxesPage, but that means other import inline requires are also disabled.
OR
Import TaxRate without any module.
OR
Create a file that contains the common onyx connection such as policy, import it like above in App.tsx and TaxRate can get the all policies data from that file.
or we can get the policy data from PolicyUtilsWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
[-]Taxes - App crashes when trying to disable tax rate.[/-][+][$250] Taxes - App crashes when trying to disable tax rate.[/+]melvin-bot commentedon Feb 11, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021889364840283872581
29 remaining items
melvin-bot commentedon Feb 20, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.1-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-27. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Feb 20, 2025
@parasharrajat @abekkala @parasharrajat 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]
abekkala commentedon Feb 20, 2025
PAYMENT SUMMARY FOR FEB 27
please complete checklist
melvin-bot commentedon Feb 27, 2025
Payment Summary
Upwork Job
BugZero Checklist (@abekkala)
parasharrajat commentedon Feb 27, 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: Fix cycle dependencies in metro console #53852 (comment)
[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: https://expensify.slack.com/archives/C01GTK53T8Q/p1739629404707799
[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: https://github.com/Expensify/Expensify/issues/474914
Regression Test Proposal
Test:
Do we agree 👍 or 👎
bernhardoj commentedon Feb 27, 2025
Requested in ND.
abekkala commentedon Feb 27, 2025
posting again for better visibility for payee:
PAYMENT SUMMARY FOR FEB 27
Thank you! 🎉
parasharrajat commentedon Mar 1, 2025
Payment requested as per #56158 (comment)
JmillsExpensify commentedon Mar 3, 2025
$250 approved for @parasharrajat
JmillsExpensify commentedon Mar 3, 2025
$250 approved for @bernhardoj