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-06-20] [HOLD for payment 2024-06-18] [$250] Taxes - User is able to add new tax rate using deep link #42925

Closed
1 of 6 tasks
lanitochka17 opened this issue May 31, 2024 · 27 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 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented May 31, 2024

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.78-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Issue found when executing PR #42192

Action Performed:

Pre-requisite:

  1. Navigate to staging.new.expensify.com
  2. Import taxes on Accounted page if not already imported
  3. Go to taxes page and deep link to add new tax rate page (i.e change the url to look like this: https://staging.new.expensify.com/settings/workspaces/<WORKSPACE_ID>/taxes/new

Expected Result:

Not found page shows up

Actual Result:

User is able to add a new tax rate

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

Bug6497169_1717144406016.bandicam_2024-05-31_11-28-11-821.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012da44be2618c21c5
  • Upwork Job ID: 1797644044811587584
  • Last Price Increase: 2024-06-03
  • Automatic offers:
    • tienifr | Contributor | 102596329
Issue OwnerCurrent Issue Owner: @puneetlath
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 31, 2024
Copy link

melvin-bot bot commented May 31, 2024

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

@lanitochka17
Copy link
Author

@puneetlath 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

@lanitochka17
Copy link
Author

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

@ShridharGoel
Copy link
Contributor

ShridharGoel commented May 31, 2024

Proposal

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

Taxes - User is able to add new tax rate using deep link.

What is the root cause of that problem?

In WorkspaceCreateTaxPage we are not blocking access if hasAccountingConnections is true.

<AccessOrNotFoundWrapper
accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.PAID]}
policyID={policyID}
featureName={CONST.POLICY.MORE_FEATURES.ARE_TAXES_ENABLED}
>

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

Add shouldOpenProfileOnBackPress as a prop in AccessOrNotFoundWrapper:

Update onBackButtonPress:

onBackButtonPress={shouldOpenProfileOnBackPress ? () => Navigation.goBack(policyID ? ROUTES.WORKSPACE_PROFILE.getRoute(policyID) : ROUTES.HOME) : () => Navigation.goBack()}

We also need to discuss if we want to keep shouldOpenProfileOnBackPress as true by default or should we keep it as false. If we want to keep the existing flow in other places, we will need to make it's default value as true.

function AccessOrNotFoundWrapper({accessVariants = [], fullPageNotFoundViewProps, shouldBeBlocked, shouldOpenProfileOnBackPress = true, ...props}: AccessOrNotFoundWrapperProps)

shouldOpenProfileOnBackPress will be passed to PageNotFoundFallback.

Add the below in AccessOrNotFoundWrapper:

shouldBeBlocked={PolicyUtils.hasAccountingConnections(policy)}

It will look like this:

<AccessOrNotFoundWrapper
    accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.PAID]}
    policyID={policyID}
    featureName={CONST.POLICY.MORE_FEATURES.ARE_TAXES_ENABLED}
    shouldBeBlocked={PolicyUtils.hasAccountingConnections(policy)}
    shouldOpenProfileOnBackPress={false}
>

Same needs to be done for categories also:

Get policy using:

const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${route.params.policyID}`);

Then update like below:

<AccessOrNotFoundWrapper
    accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.PAID]}
    policyID={route.params.policyID}
    featureName={CONST.POLICY.MORE_FEATURES.ARE_CATEGORIES_ENABLED}
    shouldBeBlocked={PolicyUtils.hasAccountingConnections(policy)}
    shouldOpenProfileOnBackPress={false}
>

We need to do the same for tag page as well. Also, check if same needs to be done at some other place.

const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${route.params.policyID}`);
<AccessOrNotFoundWrapper
    accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.PAID]}
    policyID={route.params.policyID}
    featureName={CONST.POLICY.MORE_FEATURES.ARE_TAGS_ENABLED}
    shouldBeBlocked={PolicyUtils.hasAccountingConnections(policy) || PolicyUtils.isMultiLevelTags(policyTags)}
    shouldOpenProfileOnBackPress={false}
>

@tienifr
Copy link
Contributor

tienifr commented Jun 1, 2024

Proposal

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

User is able to add a new tax rate

What is the root cause of that problem?

  • In WorkspaceCreateTaxPage, we do not display the not found page if PolicyUtils.hasAccountingConnections(policy) like we disable the "Add rate" button in here.

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

  • In WorkspaceCreateTaxPage, we need to display the not found page if PolicyUtils.hasAccountingConnections(policy). And then we need to make sure when user click on back button, the workspace taxes page is displayed.

  • To do it, we can user <FullPageNotFoundView shouldShow={PolicyUtils.hasAccountingConnections(policy)}> in here.

  • We can apply the same fix to other similar pages.

What alternative solutions did you explore? (Optional)

NA

@melvin-bot melvin-bot bot added the Overdue label Jun 3, 2024
@puneetlath puneetlath added the External Added to denote the issue can be worked on by a contributor label Jun 3, 2024
@melvin-bot melvin-bot bot changed the title Taxes - User is able to add new tax rate using deep link [$250] Taxes - User is able to add new tax rate using deep link Jun 3, 2024
Copy link

melvin-bot bot commented Jun 3, 2024

Job added to Upwork: https://www.upwork.com/jobs/~012da44be2618c21c5

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 3, 2024
Copy link

melvin-bot bot commented Jun 3, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Jun 3, 2024
@Ollyws
Copy link
Contributor

Ollyws commented Jun 4, 2024

@ShridharGoel Thanks for the proposal but it will cause the back button to navigate to the wrong page.
@tienifr's proposal LGTM.
🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Jun 4, 2024

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

@ShridharGoel
Copy link
Contributor

ShridharGoel commented Jun 4, 2024

Proposal

Updated to fix back button flow. Using the existing AccessOrNotFound is better than adding a new FullPageNotFound.

Also, the new prop would be useful in the future as well.

@Ollyws @puneetlath Kindly check.

@ShridharGoel
Copy link
Contributor

ShridharGoel commented Jun 4, 2024

Screen.Recording.2024-06-04.at.7.39.23.PM.mov

@ShridharGoel
Copy link
Contributor

@Ollyws Bump on the above.

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

melvin-bot bot commented Jun 4, 2024

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

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@puneetlath
Copy link
Contributor

@Ollyws do you want to take a look?

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jun 5, 2024
@tienifr
Copy link
Contributor

tienifr commented Jun 5, 2024

@Ollyws PR #43087 is ready

@ShridharGoel
Copy link
Contributor

Hello @Ollyws, my comments were ignored but at least some explanation could have been provided.

@Ollyws
Copy link
Contributor

Ollyws commented Jun 10, 2024

Ah sorry about that but your initial proposal would have caused a regression so I just went with the first working proposal, it was only modified after I'd reviewed it. But I think it was better to keep things simple here anyway.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jun 11, 2024
@melvin-bot melvin-bot bot changed the title [$250] Taxes - User is able to add new tax rate using deep link [HOLD for payment 2024-06-18] [$250] Taxes - User is able to add new tax rate using deep link Jun 11, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

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

Copy link

melvin-bot bot commented Jun 11, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.81-11 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-06-18. 🎊

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

Copy link

melvin-bot bot commented Jun 11, 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:

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

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jun 13, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-06-18] [$250] Taxes - User is able to add new tax rate using deep link [HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] Taxes - User is able to add new tax rate using deep link Jun 13, 2024
Copy link

melvin-bot bot commented Jun 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.82-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-06-20. 🎊

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

Copy link

melvin-bot bot commented Jun 13, 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:

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

@Ollyws
Copy link
Contributor

Ollyws commented Jun 20, 2024

BugZero Checklist:

  • The PR that introduced the bug has been identified. Link to the PR:

#40598

  • 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:

https://github.com/Expensify/App/pull/40598/files#r1647514401

  • 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

  • Determine if we should create a regression test for this bug.

Yes

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

Regression Test Proposal

Pre-requisite: Account should be integrated with a xero account which already had configured some taxes

1. Open app
2. Import taxes on Accounted page if not already imported
3. Go to taxes page and deep link to add new tax rate page (i.e change the url to look like this: https://staging.new.expensify.com/settings/workspaces/<WORKSPACE_ID>/taxes/new)
4. Verify not found page shows up

Do we agree 👍 or 👎

@Ollyws
Copy link
Contributor

Ollyws commented Jun 20, 2024

Requested payment in ND.

@JmillsExpensify
Copy link

Will approve the payment once I have the payment summary!

@puneetlath
Copy link
Contributor

Payment summary:

  • C - @tienifr - $250 - paid via Upwork
  • C+ - @Ollyws - $250 - to be paid via NewDot

Thanks everyone!

@JmillsExpensify
Copy link

$250 approved for @Ollyws

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 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

6 participants