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 2025-01-28] [HOLD for payment 2025-01-24] [$250] Reports - App crashes after cancelling payment on expenses with violation #55288

Closed
5 of 8 tasks
vincdargento opened this issue Jan 15, 2025 · 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 External Added to denote the issue can be worked on by a contributor

Comments

@vincdargento
Copy link

vincdargento commented Jan 15, 2025

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.86-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): Mac 15.0 / Chrome
Issue reported by: Applause Internal Team
Device used: [email protected]
App Component: Search

Action Performed:

Precondition:

  • "Members must categorize all expenses" is enabled in Categories settings.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Submit two expenses without category.
  4. Go to Reports.
  5. Go to Outstanding.
  6. Click Review button on the group expense.
  7. Click Approve > Approve all amount (if workspace has approvals).
  8. Click Pay elsewhere.
  9. Click on the report header.
  10. Click Cancel payment.
  11. Cancel the payment.
  12. Close the RHP.

Expected Result:

App will not crash.

Actual Result:

App crashes.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

bug.mp4

bug.txt

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021879581827856936306
  • Upwork Job ID: 1879581827856936306
  • Last Price Increase: 2025-01-15
  • Automatic offers:
    • nkdengineer | Contributor | 105711398
Issue OwnerCurrent Issue Owner: @adelekennedy
@vincdargento vincdargento added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 DeployBlockerCash This issue or pull request should block deployment labels Jan 15, 2025
Copy link

melvin-bot bot commented Jan 15, 2025

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

Copy link

melvin-bot bot commented Jan 15, 2025

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

Copy link

melvin-bot bot commented Jan 15, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Jan 15, 2025
Copy link
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.

@vincdargento
Copy link
Author

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

@rlinoz
Copy link
Contributor

rlinoz commented Jan 15, 2025

From the error, I think this line from this PR is the problem:

https://github.com/Expensify/App/pull/54847/files#diff-577fcc5f3a5e4930916ff310e61c38edfa093792fe3ab55b9a30d2aecd8811dbR6633

cc: @luacmartins in case you know an easy fix

@rlinoz
Copy link
Contributor

rlinoz commented Jan 15, 2025

I found a fix, will open a PR shortly

@luacmartins
Copy link
Contributor

luacmartins commented Jan 15, 2025

Thanks for investigating and finding a fix!

@nkdengineer
Copy link
Contributor

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?

When we pay an expense, the violation is cleared but in the snapshot, we don't cover this case to store the value as an empty array. We only cover the case value is array without checking the current snapshot value is an array or not.

https://github.com/Expensify/react-native-onyx/pull/610/files#diff-2808ac0c9c00358eda8fccf46eb7303dabebfe3b4627c7b125dfc8dfe6edb0f2R585-R589

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

Here we should also update the snap value to the value if snapshotData[key] is an array

if (Array.isArray(value) || Array.isArray(snapshotData[key])) {
    updatedData[key] = value || [];
    return;
}

https://github.com/Expensify/react-native-onyx/blob/9c028634e8b980772913455c8601eee69d4c8953/lib/Onyx.ts#L585-L587

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

Copy link
Contributor

⚠️ @nkdengineer Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format.

@nkdengineer
Copy link
Contributor

@rlinoz What do you think about my proposal?

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Jan 15, 2025
@parasharrajat
Copy link
Member

parasharrajat commented Jan 15, 2025

I believe it is the same error as I reported here #54847 (comment). And the Onyx fix didn't fix it properly. @luacmartins @rlinoz there is a proposal above. What do you think about it>

@rlinoz rlinoz added the External Added to denote the issue can be worked on by a contributor label Jan 15, 2025
@melvin-bot melvin-bot bot changed the title Reports - App crashes after cancelling payment on expenses with violation [$250] Reports - App crashes after cancelling payment on expenses with violation Jan 15, 2025
Copy link

melvin-bot bot commented Jan 15, 2025

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

@luacmartins
Copy link
Contributor

This is fixed in staging. Leading the issue open to process payment to @nkdengineer since they worked on a fix.

Additionally, this was also a regression from #54847, which had myself as the author and @parasharrajat as reviewer. I believe no further payments are needed for us.

@luacmartins luacmartins removed the DeployBlockerCash This issue or pull request should block deployment label Jan 16, 2025
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jan 17, 2025
@melvin-bot melvin-bot bot changed the title [$250] Reports - App crashes after cancelling payment on expenses with violation [HOLD for payment 2025-01-24] [$250] Reports - App crashes after cancelling payment on expenses with violation Jan 17, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 17, 2025
Copy link

melvin-bot bot commented Jan 17, 2025

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

Copy link

melvin-bot bot commented Jan 17, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.86-3 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 2025-01-24. 🎊

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

Copy link

melvin-bot bot commented Jan 17, 2025

@parasharrajat @adelekennedy @parasharrajat The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@parasharrajat
Copy link
Member

@luacmartins @rlinoz

I wouldn't consider this a regression from the #54847 given the following reasons.

  1. I did raise this issue on the PR Add violations to Search actions #54847 (comment).
  2. The issue originates from higher-level lib but not from the code of that PR.
  3. We did solve the issue and my test case passed.
  4. I didn't get the chance to test the higher-level lib fix Process array merge in snapshot key react-native-onyx#610. As the higher level lib affects many parts of the app, there can be many cases to fix such as this one.
  5. The issue was already present on the higher level lib before this PR.
  6. The use case here is quite different from what we are doing in that PR. Cancelling payment feature is not linked to the Search page but I still raised a similar case in point 2.

What do you think?

@luacmartins
Copy link
Contributor

I think it was a regression. The bug didn't exist before that PR and existed after it, even though the issue came from a higher level lib, I should have taken that into account. That's just my opinion though.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jan 21, 2025
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2025-01-24] [$250] Reports - App crashes after cancelling payment on expenses with violation [HOLD for payment 2025-01-28] [HOLD for payment 2025-01-24] [$250] Reports - App crashes after cancelling payment on expenses with violation Jan 21, 2025
Copy link

melvin-bot bot commented Jan 21, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.87-3 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 2025-01-28. 🎊

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

Copy link

melvin-bot bot commented Jan 21, 2025

@parasharrajat @adelekennedy @parasharrajat The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jan 24, 2025
Copy link

melvin-bot bot commented Jan 27, 2025

@rlinoz, @luacmartins, @parasharrajat, @adelekennedy, @nkdengineer Whoops! This issue is 2 days overdue. Let's get this updated quick!

@luacmartins
Copy link
Contributor

Payment due tomorrow

@adelekennedy
Copy link

Contributor: @nkdengineer paid $250 via Upwork
Contributor+: @parasharrajat  owed $250 via NewDot

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jan 29, 2025
Copy link

melvin-bot bot commented Feb 3, 2025

@rlinoz, @luacmartins, @parasharrajat, @adelekennedy, @nkdengineer Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot removed the Overdue label Feb 3, 2025
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

7 participants