Open IuliiaHerets opened 16 hours ago
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.
We think that this bug might be related to #wave-collect - Release 1
@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
Distance - App crashes after selecting rate that has no Tax rate & Tax reclaimable on
We are not adding optional chaining before value
below
https://github.com/Expensify/App/blob/513e6b3c714adbe24cd8b88c9fc9c20130a6c9d4/src/libs/ReportUtils.ts#L3477
Add optional chaining before value
originalMessage.taxRate = transactionChanges?.taxCode && policy?.taxRates?.taxes[transactionChanges?.taxCode]?.value;
App crashes after selecting distance rate that has no Tax rate and Tax reclaimable on.
When track tax is enabled and we select the rate that has no tax rate, taxRateExternalID
here is -1
Then here we passed it to transactionChanges
because updatedTaxCode
is not empty
https://github.com/Expensify/App/blob/513e6b3c714adbe24cd8b88c9fc9c20130a6c9d4/src/libs/actions/IOU.ts#L3176-L3180
Then the app crashes here because policy?.taxRates?.taxes[transactionChanges?.taxCode]
is undefined
with transactionChanges?.taxCode
as -1
https://github.com/Expensify/App/blob/83835702a43ee9299475e406fa7aa10027e05584/src/libs/ReportUtils.ts#L3475-L3477
Safely get the value field here
policy?.taxRates?.taxes[transactionChanges?.taxCode]?.value
https://github.com/Expensify/App/blob/83835702a43ee9299475e406fa7aa10027e05584/src/libs/ReportUtils.ts#L3475-L3477
And we can fallback taxRateExternalID
as empty string
or add a check here to not add taxCode
to transactionChanges
if it's -1
)updatedTaxCode && updatedTaxCode !== '-1') ? {taxCode: updatedTaxCode} : {}
NA
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
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:
Expected Result:
App will not crash.
Actual Result:
App crashes after selecting distance rate that has no Tax rate and Tax reclaimable on.
Crash happens when the rate has
Workaround:
Unknown
Platforms:
Screenshots/Videos
2009_1.txt
https://github.com/user-attachments/assets/4a41aae2-5e23-4bc7-bbdf-24b7373298da
View all open jobs on GitHub