Skip to content

Taxes - Missing tax rates in currency default list & app crashes when clicking on foreign rate #39602

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:

  1. Go to staging.new.expensify.com
    2.Create a new (Collect) workspace.
  2. Go to Collect workspace settings > More features
  3. Toggle on Taxes.
  4. Go to Taxes tab.
  5. Click Settings > Workspace currency default.
  6. Go to Foreign currency default.
  7. Click on the selected default tax.

Expected Result:

In Step 6 and 7, all other available taxes will show up in the list.
In Step 8, app will not crash.

Actual Result:

In Step 6 and 7, only the selected default tax shows up in the list.
In Step 8, app crashes

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

Bug6437926_1712233913737.default_tax_and_crash.mp4

View all open jobs on GitHub

Activity

  1. melvin-bot commented on Apr 4, 2024

    @melvin-bot

    Triggered auto assignment to @pecanoro (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 - Missing tax rates in currency default list & app crashes when clicking on foreign rate

    What is the root cause of that problem?

    Actually looks like the BE issue
    Because when we choose the same Workspace currency we get from BE new empty tax
    As result we get crash that we try to get name from undefined

    const submit = ({keyForList}: ListItem) => {
    setWorkspaceCurrencyDefault(policyID, keyForList ?? '');
    Navigation.goBack(ROUTES.WORKSPACE_TAXES_SETTINGS.getRoute(policyID));
    };

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

    To fix this issue we can add condition to just close current screen when we choose the same value without selecting the value

            if (selectedTaxRate === keyForList) {
                Navigation.goBack(ROUTES.WORKSPACE_TAXES_SETTINGS.getRoute(policyID));
                return;
            }
    

    And we can filter the list when we don't have mandatory values( Or just update name like (value?.name ?? '') and other fields)

    const taxesList = useMemo<ListItem[]>(
    () =>
    Object.entries(policy?.taxRates?.taxes ?? {})
    .map(([key, value]) => ({
    text: value.name,
    alternateText: textForDefault(key),
    keyForList: key,
    isSelected: !!selectedTaxesIDs.includes(key),
    isDisabledCheckbox: key === defaultExternalID,
    pendingAction: value.pendingAction,
    errors: value.errors,
    rightElement: (
    <View style={styles.flexRow}>
    <Text style={[styles.disabledText, styles.alignSelfCenter]}>
    {value.isDisabled ? translate('workspace.common.disabled') : translate('workspace.common.enabled')}
    </Text>
    <View style={[styles.p1, styles.pl2]}>
    <Icon
    src={Expensicons.ArrowRight}
    fill={theme.icon}
    />
    </View>
    </View>
    ),
    }))
    .sort((a, b) => a.text.localeCompare(b.text)),
    [policy?.taxRates?.taxes, textForDefault, defaultExternalID, selectedTaxesIDs, styles, theme.icon, translate],
    );

    What alternative solutions did you explore? (Optional)

    NA

  5. pecanoro commented on Apr 4, 2024

    @pecanoro
    Contributor

    @ZhenjaHorbach don't add proposals until the Help Wanted is applied. Since this a deploy blocker, I am looking for this to get fixed by whoever broke it.

  6. pecanoro commented on Apr 4, 2024

    @pecanoro
    Contributor

    I am confident this deploy blocker is coming from #33927

  7. MonilBhavsar commented on Apr 4, 2024

    @MonilBhavsar
    Contributor

    Looking...

  8. self-assigned this
    on Apr 4, 2024
  9. teneeto commented on Apr 4, 2024

    @teneeto
    Contributor

    Hi, I'm Eto from Callstack - expert contributor group - and I would like to take care of this issue.

  10. pecanoro commented on Apr 4, 2024

    @pecanoro
    Contributor

    @teneeto Any updates on this? It's a deploy blocker so we either need to fix it asap or revert the original PR

  11. MonilBhavsar commented on Apr 4, 2024

    @MonilBhavsar
    Contributor

    PR is up #39646

  12. MonilBhavsar commented on Apr 5, 2024

    @MonilBhavsar
    Contributor

    PR is merged. Requested CP

  13. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Apr 5, 2024
  14. MonilBhavsar commented on Apr 5, 2024

    @MonilBhavsar
    Contributor

    Works well, no action required here

    Screen.Recording.2024-04-05.at.6.18.06.PM.mov
  15. pecanoro commented on Apr 22, 2024

    @pecanoro
    Contributor

    All done, closing!

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions