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

[PAID] [$250] Taxes - App crashes when visiting transaction thread with invalid tax rate on a fresh session #39695

Closed
6 tasks done
izarutskaya opened this issue Apr 5, 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 Engineering Internal Requires API changes or must be handled by Expensify staff

Comments

@izarutskaya
Copy link

izarutskaya commented Apr 5, 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.60-8
Reproducible in staging?: Y
Reproducible in production?: N
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

Precondition:

  • Admin and employee are in the same Collect workspace.
  • The Collect workspace has several tax rates.
  1. Go to staging.new.expensify.com
  2. [Employee] Go to workspace chat.
  3. [Employee] Create manual request with a tax rate in workspace chat.
  4. [Admin] On Old Dot, delete the tax rate selected in Step 3.
  5. [Employee] Go to Settings > About > Troubleshoot > Clear cache and restart > Reset and refresh (relogin can also be done).
  6. [Employee] Navigate to the transaction thread with invalid tax rate.

Expected Result:

App should not crash.

Actual Result:

App crashes.

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

Bug6438754_1712289000506.20240405_114247.mp4

Bug6438754_1712289000497!staging.new.expensify.com-1712288865325.txt

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01bfd8b2886cedb8f1
  • Upwork Job ID: 1776209471760666624
  • Last Price Increase: 2024-04-05
  • Automatic offers:
    • shubham1206agra | Contributor | 0
@izarutskaya izarutskaya added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 5, 2024
Copy link

melvin-bot bot commented Apr 5, 2024

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

Copy link

melvin-bot bot commented Apr 5, 2024

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

Copy link
Contributor

github-actions bot commented Apr 5, 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.

@izarutskaya
Copy link
Author

@strepanier03 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.

@izarutskaya
Copy link
Author

We think this issue might be related to the #collect project.

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Apr 5, 2024
Copy link

melvin-bot bot commented Apr 5, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01bfd8b2886cedb8f1

@melvin-bot melvin-bot bot changed the title Taxes - App crashes when visiting transaction thread with invalid tax rate on a fresh session [$250] Taxes - App crashes when visiting transaction thread with invalid tax rate on a fresh session Apr 5, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 5, 2024
Copy link

melvin-bot bot commented Apr 5, 2024

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

@izarutskaya
Copy link
Author

Production

bandicam.2024-04-05.12-28-46-037.mp4

@MonilBhavsar MonilBhavsar self-assigned this Apr 5, 2024
@nkdengineer
Copy link
Contributor

nkdengineer commented Apr 5, 2024

Proposal

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

App crashes.

What is the root cause of that problem?

In here, we don't check if taxRates is defined or not before trying to get the name.

We have the same problem when getting .value as well, like in here

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

In here, if taxes?.[transactionTaxCode] is undefined, early return undefined/empty string.

if (!taxes?.[transactionTaxCode]) {
    return '';
}

We must return empty string here because if we just use ?.name it will display undefined (undefined) in the MoneyRequestView which looks broken.

In some places we can use ? and ?? '' to chain when getting the name, so it doesn't crash.

There're other places where tax rate name is accessed unsafely like this too, and should be fixed similarly.

What alternative solutions did you explore? (Optional)

NA

@getusha
Copy link
Contributor

getusha commented Apr 5, 2024

Looks similar to #39167

@MonilBhavsar
Copy link
Contributor

Looks different to me @getusha

@shahinyan11
Copy link
Contributor

shahinyan11 commented Apr 5, 2024

Proposal

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

Taxes - App crashes when visiting transaction thread with invalid tax rate on a fresh session

What is the root cause of that problem?

Here and here we do not get the name optionally

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

Use ?.name instead

What alternative solutions did you explore? (Optional)

@nkdengineer
Copy link
Contributor

@MonilBhavsar Just checking if you're working on this directly or will select a contributor to quickly fix it?

Since I see you self-assigned but the issue still has Help Wanted label, so conflicting signals.

@MonilBhavsar
Copy link
Contributor

I had a look at both proposals and it misses some places where fix needs to be applied. So I am now working on this, given this is a deploy blocker. Thanks for the proposal though!

@nkdengineer
Copy link
Contributor

nkdengineer commented Apr 5, 2024

@MonilBhavsar I think we can normally handle the some places where fix needs to be applied part in the PR since the solution is same for those places, and we'll do thorough testing during PR phase. (assuming you're saying the solution looks correct but missing the permalinks to every place where the issue happens)

There're other places where tax rate name is accessed unsafely like this too, and should be fixed similarly.

Since this issue is Help Wanted, we would appreciate if contributors are allowed to handle this (if has a good solution)

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Hourly KSv2 labels Apr 5, 2024
@MonilBhavsar
Copy link
Contributor

sorry, the proposal differed a lot from expected solution and since deploy blockers are very high priority issues, we would prefer complete proposals, so we could ship it as soon as possible without much back and forth during PR reviews.

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

melvin-bot bot commented Apr 5, 2024

📣 @shubham1206agra 🎉 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 📖

@MonilBhavsar MonilBhavsar added Internal Requires API changes or must be handled by Expensify staff and removed External Added to denote the issue can be worked on by a contributor labels Apr 5, 2024
Copy link

melvin-bot bot commented Apr 5, 2024

Current assignee @shubham1206agra is eligible for the Internal assigner, not assigning anyone new.

@MonilBhavsar
Copy link
Contributor

@MonilBhavsar MonilBhavsar removed the DeployBlockerCash This issue or pull request should block deployment label Apr 5, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 8, 2024
@melvin-bot melvin-bot bot changed the title [$250] Taxes - App crashes when visiting transaction thread with invalid tax rate on a fresh session [HOLD for payment 2024-04-15] [$250] Taxes - App crashes when visiting transaction thread with invalid tax rate on a fresh session Apr 8, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 8, 2024
Copy link

melvin-bot bot commented Apr 8, 2024

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

Copy link

melvin-bot bot commented Apr 8, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.60-13 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-04-15. 🎊

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

Copy link

melvin-bot bot commented Apr 8, 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:

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Apr 14, 2024
@strepanier03
Copy link
Contributor

@shubham1206agra - Please finish up the checklist when you have a chance and I'll finish up on my end once you do. Thanks!

@shubham1206agra
Copy link
Contributor

@MonilBhavsar Can you confirm if this issue is eligible for $500 compensation as the issue was created before April 6th?

@strepanier03
Copy link
Contributor

strepanier03 commented Apr 17, 2024

I'm fairly certain PR reviews that don't require a lot of changes or intense testing should be $250, even prior to the price change that went into effect on April 6th.

@shubham1206agra
Copy link
Contributor

shubham1206agra commented Apr 18, 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:

@strepanier03 strepanier03 changed the title [HOLD for payment 2024-04-15] [$250] Taxes - App crashes when visiting transaction thread with invalid tax rate on a fresh session [PAID] [$250] Taxes - App crashes when visiting transaction thread with invalid tax rate on a fresh session Apr 19, 2024
@strepanier03
Copy link
Contributor

Thanks for the checklist @shahinyan11- I've paid out the contract and closed it in Upwork. Thanks again!

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 Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

No branches or pull requests

10 participants