Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2024-08-19] [$250] iOS - Taxes - Unable to select Foreign currency default via checkbox #46657

Closed
1 of 6 tasks
lanitochka17 opened this issue Aug 1, 2024 · 21 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 1, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.15-4
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4801379
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Taxes
  3. Tap Settings
  4. Tap Foreign currency default
  5. Select another tax that is not Workspace currency default as Foreign currency default
  6. Return to tax list
  7. Long press on the Foreign currency default
  8. Tap Select
  9. Tap on the checkbox next to Foreign currency default
  10. Note that Foreign currency default cannot be selected via the checkbox
  11. Tap Select all checkbox
  12. Note that Foreign currency default can be selected via Select all checkbox

Expected Result:

In Step 10, user should be able to select Foreign currency default via the checkbox (production behavior).\

Actual Result:

In Step 10, user is unable to select Foreign currency default via the checkbox
However, it can be selected via Select all checkbox (Step 12)

Workaround:

Unknown

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

Bug6559080_1722507730868.ScreenRecording_08-01-2024_18-15-01_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019b20d5176ab3a33e
  • Upwork Job ID: 1820468883128659309
  • Last Price Increase: 2024-08-05
  • Automatic offers:
    • ahmedGaber93 | Reviewer | 103414421
Issue OwnerCurrent Issue Owner: @zanyrenney
@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API labels Aug 1, 2024
Copy link

melvin-bot bot commented Aug 1, 2024

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

Copy link
Contributor

github-actions bot commented Aug 1, 2024

👋 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.

@lanitochka17
Copy link
Author

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

@Julesssss Julesssss added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. and removed Hourly KSv2 DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API labels Aug 1, 2024
Copy link

melvin-bot bot commented Aug 1, 2024

Triggered auto assignment to @zanyrenney (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.

@Julesssss
Copy link
Contributor

Minor issue, not going to block release

@bernhardoj
Copy link
Contributor

bernhardoj commented Aug 1, 2024

Proposal

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

Can't select the default foreign currency by toggling the checkbox.

What is the root cause of that problem?

When pressing the checkbox, it will do nothing if the tax is the workspace currency default or foreign currency default.

const toggleTax = (tax: ListItem) => {
const key = tax.keyForList;
if (typeof key !== 'string' || key === defaultExternalID || key === foreignTaxDefault) {
return;
}

We already disable the checkbox here if we can't delete the tax.

isDisabledCheckbox: !PolicyUtils.canEditTaxRate(policy, key),

App/src/libs/PolicyUtils.ts

Lines 416 to 418 in e0f17df

function canEditTaxRate(policy: Policy, taxID: string): boolean {
return policy.taxRates?.defaultExternalID !== taxID;
}

However, canEditTaxRate only checks for workspace currency default.

Also, when we toggle select all checkbox, we already filter out workspace currency default tax, but not for foreign currency default.

const toggleAllTaxes = () => {
const taxesToSelect = taxesList.filter((tax) => tax.keyForList !== defaultExternalID && tax.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);

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

Update PolicyUtils.canEditTaxRate and select all logic to check for foreign currency default too.

function canEditTaxRate(policy: Policy, taxID: string): boolean {
    return policy.taxRates?.defaultExternalID !== taxID && policy.taxRates?.foreignTaxDefault !== taxID;
}
const taxesToSelect = taxesList.filter((tax) => tax.keyForList !== defaultExternalID && tax.keyForList !== foreignTaxDefault && ...);

What alternative solutions did you explore? (Optional)

Allow user to toggle foreign currency default tax by removing key === foreignTaxDefault

const toggleTax = (tax: ListItem) => {
const key = tax.keyForList;
if (typeof key !== 'string' || key === defaultExternalID || key === foreignTaxDefault) {
return;
}

@melvin-bot melvin-bot bot added the Overdue label Aug 5, 2024
@Julesssss Julesssss added the External Added to denote the issue can be worked on by a contributor label Aug 5, 2024
Copy link

melvin-bot bot commented Aug 5, 2024

Job added to Upwork: https://www.upwork.com/jobs/~019b20d5176ab3a33e

@melvin-bot melvin-bot bot changed the title iOS - Taxes - Unable to select Foreign currency default via checkbox [$250] iOS - Taxes - Unable to select Foreign currency default via checkbox Aug 5, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 5, 2024
Copy link

melvin-bot bot commented Aug 5, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @ahmedGaber93 (External)

@melvin-bot melvin-bot bot removed the Overdue label Aug 5, 2024
@ahmedGaber93
Copy link
Contributor

@bernhardoj's proposal LGTM!

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Aug 5, 2024

Current assignee @Julesssss is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 6, 2024
Copy link

melvin-bot bot commented Aug 6, 2024

📣 @ahmedGaber93 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 6, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @ahmedGaber93

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 12, 2024
@melvin-bot melvin-bot bot changed the title [$250] iOS - Taxes - Unable to select Foreign currency default via checkbox [HOLD for payment 2024-08-19] [$250] iOS - Taxes - Unable to select Foreign currency default via checkbox Aug 12, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 12, 2024
Copy link

melvin-bot bot commented Aug 12, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Aug 12, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.18-10 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-08-19. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Aug 12, 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:

  • [@ahmedGaber93] The PR that introduced the bug has been identified. Link to the PR:
  • [@ahmedGaber93] 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:
  • [@ahmedGaber93] 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:
  • [@ahmedGaber93] Determine if we should create a regression test for this bug.
  • [@ahmedGaber93] 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.
  • [@zanyrenney] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@zanyrenney
Copy link
Contributor

waiting for 7 days.

@ahmedGaber93
Copy link
Contributor

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:

Regression Test Proposal

  1. Open workspace tax page
  2. Make sure you have more than 2 taxes
  3. Open the tax settings and set the workspace currency default and foreign currency default (should be different tax selected)
  4. Try to select taxes and verify the checkbox of the workspace currency default and foreign currency default taxes are disabled
  5. Press the Select all checkbox
  6. Verify all non-default taxes are selected

Do we agree 👍 or 👎

@zanyrenney
Copy link
Contributor

#47636

@melvin-bot melvin-bot bot removed the Overdue label Aug 19, 2024
@zanyrenney
Copy link
Contributor

payment summary

@ahmedGaber93 requires payment automatic offer (Reviewer) - paid $250 via upwork
@bernhardoj requires payment through NewDot Manual Requests - owed $250, please request via ND.

Thanks!

@bernhardoj
Copy link
Contributor

Requested in ND.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

6 participants