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 2024-10-14] [$250] [P2P Distance] App crashes after selecting rate that has no Tax rate & Tax reclaimable on #49556
Version Number: 9.0.39-0 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers):applausetester+zm22@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Launch New Expensify app.
Create a new workspace.
Enable Distance rates and Taxes.
Go to Distance rates > Settings > Enable Track tax.
Add a distance rate and leave Tax rate and Tax reclaimable on fields empty.
Submit a distance expense in the workspace chat.
Go to transaction thread.
Click Rate.
Select the other distance rate that does not have Tax rate and Tax reclaimable on.
Expected Result:
App will not crash.
Actual Result:
App crashes after selecting distance rate that has no Tax rate and Tax reclaimable on.
@OfstadC FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
changed the title [-]Distance - App crashes after selecting rate that has no Tax rate & Tax reclaimable on[/-][+][P2P Distance] App crashes after selecting rate that has no Tax rate & Tax reclaimable on[/+]on Sep 23, 2024
changed the title [-][P2P Distance] App crashes after selecting rate that has no Tax rate & Tax reclaimable on[/-][+][$250] [P2P Distance] App crashes after selecting rate that has no Tax rate & Tax reclaimable on[/+]on Sep 24, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.45-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@aimane-chnaif] The PR that introduced the bug has been identified. Link to the PR:
[@aimane-chnaif] 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:
[@aimane-chnaif] A discussion in #expensify-bugs 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:
[@aimane-chnaif] Determine if we should create a regression test for this bug.
[@aimane-chnaif] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@OfstadC] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
A discussion in #expensify-bugs 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
Regression Test Proposal
Create a new workspace.
Enable Distance rates and Taxes.
Go to Distance rates > Settings > Enable Track tax.
Add a distance rate and leave Tax rate and Tax reclaimable on fields empty.
Submit a distance expense in the workspace chat.
Go to transaction thread.
Click Rate.
Select the other distance rate that does not have Tax rate and Tax reclaimable on.
Activity
melvin-bot commentedon Sep 20, 2024
Triggered auto assignment to @OfstadC (
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.IuliiaHerets commentedon Sep 20, 2024
We think that this bug might be related to #wave-collect - Release 1
IuliiaHerets commentedon Sep 20, 2024
@OfstadC FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
etCoderDysto commentedon Sep 20, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Distance - App crashes after selecting rate that has no Tax rate & Tax reclaimable on
What is the root cause of that problem?
We are not adding optional chaining before
valuebelowApp/src/libs/ReportUtils.ts
Line 3477 in 513e6b3
What changes do you think we should make in order to solve the problem?
Add optional chaining before value
What alternative solutions did you explore? (Optional)
nkdengineer commentedon Sep 20, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
App crashes after selecting distance rate that has no Tax rate and Tax reclaimable on.
What is the root cause of that problem?
When track tax is enabled and we select the rate that has no tax rate,
taxRateExternalIDhere is-1App/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx
Lines 95 to 107 in 513e6b3
Then here we passed it to
transactionChangesbecauseupdatedTaxCodeis not emptyApp/src/libs/actions/IOU.ts
Lines 3176 to 3180 in 513e6b3
Then the app crashes here because
policy?.taxRates?.taxes[transactionChanges?.taxCode]isundefinedwithtransactionChanges?.taxCodeas-1App/src/libs/ReportUtils.ts
Lines 3475 to 3477 in 8383570
What changes do you think we should make in order to solve the problem?
Safely get the value field here
App/src/libs/ReportUtils.ts
Lines 3475 to 3477 in 8383570
And we can fallback
taxRateExternalIDas empty stringApp/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx
Lines 95 to 107 in 513e6b3
or add a check here to not add
taxCodetotransactionChangesif it's-1App/src/libs/actions/IOU.ts
Lines 3176 to 3180 in 513e6b3
What alternative solutions did you explore? (Optional)
NA
OfstadC commentedon Sep 23, 2024
Added to Wave Collect - will confirm before adding External
[-]Distance - App crashes after selecting rate that has no Tax rate & Tax reclaimable on[/-][+][P2P Distance] App crashes after selecting rate that has no Tax rate & Tax reclaimable on[/+][-][P2P Distance] App crashes after selecting rate that has no Tax rate & Tax reclaimable on[/-][+][$250] [P2P Distance] App crashes after selecting rate that has no Tax rate & Tax reclaimable on[/+]20 remaining items
melvin-bot commentedon Oct 7, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.45-4 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 2024-10-14. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Oct 7, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
OfstadC commentedon Oct 10, 2024
@aimane-chnaif Please complete the BZ checklist so I can issue payment on the 14th. Thank you! 😃
aimane-chnaif commentedon Oct 14, 2024
Regression Test Proposal
OfstadC commentedon Oct 14, 2024
Thanks @aimane-chnaif ! Could you please accept this offer so I can issue payment? 😃
OfstadC commentedon Oct 14, 2024
Payment Summary
pending offer in Upworkpaid $250 via UpworkOfstadC commentedon Oct 17, 2024
Will close once @aimane-chnaif accepts Upwork offer 😃