Skip to content

[$500] Taxes - App crashes when changing tax rate to 0% on native apps and it shows 00 on web #39600

Closed

Description

@kbecciv

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: 1.4.60-1
Reproducible in staging?: y
Reproducible in production?: n
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • User is an employee of Collect workspace that has taxes.
  • One of the tax rates is 0%.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create a manual request with tax that is not 0%.
  4. Go to transaction thread.
  5. Click Tax.
  6. Select the 0% tax rate.

Expected Result:

App does not crash

Actual Result:

App crashes. On web and desktop app, it shows 00 instead of crashing

Workaround:

n/a

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6437919_1712233908134.iOS.mp4
Bug6437919_1712233908103.tax_0__web.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01738457c70add314d
  • Upwork Job ID: 1776310057649451008
  • Last Price Increase: 2024-04-05

Activity

  1. melvin-bot commented on Apr 4, 2024

    @melvin-bot

    Triggered auto assignment to @srikarparsi (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  2. github-actions commented on Apr 4, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  3. kbecciv commented on Apr 4, 2024

    @kbecciv
    Author

    We think that this bug might be related to #wave-collect - Release 1

  4. ZhenjaHorbach commented on Apr 4, 2024

    @ZhenjaHorbach
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Taxes - App crashes when changing tax rate to 0% on native apps and it shows 00 on web

    What is the root cause of that problem?

    The main problem with issue is that shouldShowTax can return number

    const shouldShowTax = isTaxPolicyEnabled(isPolicyExpenseChat, policy) && transactionTaxCode && transactionTaxAmount;

    As result we show 0 like text(For web) instead hide this element
    For native we get crash

    {shouldShowTax && (
    <OfflineWithFeedback pendingAction={getPendingFieldAction('taxCode')}>
    <MenuItemWithTopDescription
    title={taxRateTitle ?? ''}
    description={taxRatesDescription}
    interactive={canEdit}
    shouldShowRightIcon={canEdit}
    titleStyle={styles.flex1}
    onPress={() => Navigation.navigate(ROUTES.EDIT_REQUEST.getRoute(report.reportID, CONST.EDIT_REQUEST_FIELD.TAX_RATE))}
    />
    </OfflineWithFeedback>
    )}

    {shouldShowTax && (
    <OfflineWithFeedback pendingAction={getPendingFieldAction('taxAmount')}>
    <MenuItemWithTopDescription
    title={formattedTaxAmount ? formattedTaxAmount.toString() : ''}
    description={translate('iou.taxAmount')}
    interactive={canEdit}
    shouldShowRightIcon={canEdit}
    titleStyle={styles.flex1}
    onPress={() => Navigation.navigate(ROUTES.EDIT_REQUEST.getRoute(report.reportID, CONST.EDIT_REQUEST_FIELD.TAX_AMOUNT))}
    />
    </OfflineWithFeedback>
    )}

    What changes do you think we should make in order to solve the problem?

    To fix this issue we can we can convert this value to boolean (!!shouldShowTax)

    {shouldShowTax && (
    <OfflineWithFeedback pendingAction={getPendingFieldAction('taxCode')}>
    <MenuItemWithTopDescription
    title={taxRateTitle ?? ''}
    description={taxRatesDescription}
    interactive={canEdit}
    shouldShowRightIcon={canEdit}
    titleStyle={styles.flex1}
    onPress={() => Navigation.navigate(ROUTES.EDIT_REQUEST.getRoute(report.reportID, CONST.EDIT_REQUEST_FIELD.TAX_RATE))}
    />
    </OfflineWithFeedback>
    )}

    {shouldShowTax && (
    <OfflineWithFeedback pendingAction={getPendingFieldAction('taxAmount')}>
    <MenuItemWithTopDescription
    title={formattedTaxAmount ? formattedTaxAmount.toString() : ''}
    description={translate('iou.taxAmount')}
    interactive={canEdit}
    shouldShowRightIcon={canEdit}
    titleStyle={styles.flex1}
    onPress={() => Navigation.navigate(ROUTES.EDIT_REQUEST.getRoute(report.reportID, CONST.EDIT_REQUEST_FIELD.TAX_AMOUNT))}
    />
    </OfflineWithFeedback>
    )}

    But it's a little unclear here
    Should we hide the ability to select taxes when we have chosen the default value (0)?

    Because in this case we have a slightly incorrect condition that hides the item menu when the tax value is 0

    const shouldShowTax = isTaxPolicyEnabled(isPolicyExpenseChat, policy) && transactionTaxCode && transactionTaxAmount;

    What alternative solutions did you explore? (Optional)

    NA

  5. self-assigned this
    on Apr 4, 2024
  6. MonilBhavsar commented on Apr 4, 2024

    @MonilBhavsar
    Contributor

    Looking

  7. jasperhuangg commented on Apr 4, 2024

    @jasperhuangg
    Contributor

    PR merged ^ CPing now

  8. 19 remaining items

  9. johncschuster commented on Apr 5, 2024

    @johncschuster
    Contributor

    Changing the bounty to $500, as it was issued prior to 2024-04-05.

  10. johncschuster commented on Apr 5, 2024

    @johncschuster
    Contributor

    @allroundexperts I've invited you to the job, here. Can you accept that and ping me when you've done it so I can issue payment? Thank you!

  11. allroundexperts commented on Apr 11, 2024

    @allroundexperts
    Contributor

    Thanks @johncschuster, but I get paid through NewDot. Can you please write a payment summary instead? Thanks!

  12. melvin-bot commented on Apr 19, 2024

    @melvin-bot

    @johncschuster, @allroundexperts, @MonilBhavsar, @srikarparsi Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  13. melvin-bot commented on Apr 23, 2024

    @melvin-bot

    @johncschuster, @allroundexperts, @MonilBhavsar, @srikarparsi 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  14. melvin-bot commented on Apr 25, 2024

    @melvin-bot

    @johncschuster, @allroundexperts, @MonilBhavsar, @srikarparsi 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

  15. melvin-bot commented on Apr 29, 2024

    @melvin-bot

    @johncschuster, @allroundexperts, @MonilBhavsar, @srikarparsi 12 days overdue now... This issue's end is nigh!

  16. melvin-bot commented on May 2, 2024

    @melvin-bot

    This issue has not been updated in over 14 days. @johncschuster, @allroundexperts, @MonilBhavsar, @srikarparsi eroding to Weekly issue.

  17. johncschuster commented on May 3, 2024

    @johncschuster
    Contributor

    Payment Summary

    C+ Reviewer - @allroundexperts - $500 to be paid via Manual Request

  18. JmillsExpensify commented on May 4, 2024

    @JmillsExpensify
    Contributor

    $500 approved for @allroundexperts

  19. srikarparsi commented on May 14, 2024

    @srikarparsi
    Contributor

    Is this good to close out @johncschuster?

  20. MonilBhavsar commented on Jun 5, 2024

    @MonilBhavsar
    Contributor

    Looks like everyone is paid out, so we can close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions