Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.44k stars 2.81k forks source link

[HOLD for payment 2024-04-25] [$250] Taxes - Not here page shows up when clicking on tax rate with / symbol #39614

Closed lanitochka17 closed 5 months ago

lanitochka17 commented 6 months ago

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

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Collect workspace settings
  3. Go to Taxes
  4. Click Add rate
  5. Create a tax rate with / symbol in the name
  6. Click on the tax rate

Expected Result:

Tax rate editor opens without issue

Actual Result:

Not here page shows up when clicking on tax rate with / symbol

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/4f68c2b6-75c6-4ccd-ac67-aceacca30a78

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011b3c5959006e7d8f
  • Upwork Job ID: 1776218862688116736
  • Last Price Increase: 2024-04-05
  • Automatic offers:
    • s77rt | Reviewer | 0
    • gijoe0295 | Contributor | 0
melvin-bot[bot] commented 6 months ago

Triggered auto assignment to @twisterdotcom (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

lanitochka17 commented 6 months ago

@twisterdotcom 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 commented 6 months ago

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

gijoe0295 commented 6 months ago

Proposal

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

Not here page shows up when clicking on tax rate with / symbol

What is the root cause of that problem?

https://github.com/Expensify/App/blob/8fa9894a72118b401b855d825d2b3e059d4feb25/src/ROUTES.ts#L648

encodeURI is used to parse the tax name in URL. But encodeURI does not escape special characters including /. Reference [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI#:~:text=encodeURI()%20escapes,0%E2%80%939%20%2D%20_%20.%20!%20~%20*%20%27%20(%20)%0A%0A%3B%20/%20%3F%20%3A%20%40%20%26%20%3D%20%2B%20%24%20%2C%20%23).

https://github.com/Expensify/App/blob/d97bcd35995850a78614483a6e0ee5c3b7827fa7/src/pages/workspace/taxes/WorkspaceEditTaxPage.tsx#L73-L75

That causes the tax name to be incorrect and then we cannot retrieve the tax rate and eventually show not found page.

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

  1. We should use encodeURIComponent for encoding.
  2. In linkingConfig, use decodeURIComponent for decoding taxID, following what we've done for categories:

https://github.com/Expensify/App/blob/8fa9894a72118b401b855d825d2b3e059d4feb25/src/libs/Navigation/linkingConfig/config.ts#L272

We should apply this to all other tax routes like this and this.

What alternative solutions did you explore? (Optional)

If we don't want to allow special characters in tax name, we should modify tax name validation function to block those.

https://github.com/Expensify/App/blob/a883c05e11d31752e0706ee23dbbd891cfdd0b30/src/libs/actions/TaxRate.ts#L37

twisterdotcom commented 6 months ago

I recreated this. It's clearly to do with it affecting the URL yes.

melvin-bot[bot] commented 6 months ago

Job added to Upwork: https://www.upwork.com/jobs/~011b3c5959006e7d8f

melvin-bot[bot] commented 6 months ago

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

s77rt commented 6 months ago

@gijoe0295 Thanks for the proposal. Your RCA is correct. The solution looks good to me πŸ‘

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed Link to proposal

melvin-bot[bot] commented 6 months ago

Triggered auto assignment to @stitesExpensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

s77rt commented 6 months ago

@stitesExpensify can you please review https://github.com/Expensify/App/issues/39614#issuecomment-2040795180

melvin-bot[bot] commented 6 months ago

πŸ“£ @s77rt πŸŽ‰ 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[bot] commented 6 months ago

πŸ“£ @gijoe0295 πŸŽ‰ 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 πŸ“–

melvin-bot[bot] commented 5 months ago

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

melvin-bot[bot] commented 5 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.62-17 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-04-25. :confetti_ball:

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

melvin-bot[bot] commented 5 months ago

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:

s77rt commented 5 months ago
twisterdotcom commented 5 months ago

Payment Summary: