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-07-10] [HOLD for payment 2024-07-02] [$250] Search - RHP loads infinitely when deleting expense from report details page #44212

Closed
5 of 6 tasks
m-natarajan opened this issue Jun 22, 2024 · 30 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Jun 22, 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: 9.0.1-0
Reproducible in staging?: y
Reproducible in production?: n
If this was caught during regression testing, add the test name, ID and link from TestRail: exp around vhttps://expensify.testrail.io/index.php?/tests/view/4662005
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to DM.
  3. Submit an expense to the user.
  4. Go to Search.
  5. Click on the expense submitted in Step 3.
  6. Click on the report header.
  7. Click Delete expense.
  8. Delete the expense.

Expected Result:

RHP will close because the transaction is deleted.

Actual Result:

RHP loads infinitely.

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

Bug6521562_1719066498914.20240622_202515.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012d8ed6a1d54a3505
  • Upwork Job ID: 1805219999552454866
  • Last Price Increase: 2024-06-24
  • Automatic offers:
    • tsa321 | Contributor | 102864301
    • c3024 | Contributor | 102869949
Issue OwnerCurrent Issue Owner: @jliexpensify
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Jun 22, 2024
Copy link

melvin-bot bot commented Jun 22, 2024

Triggered auto assignment to @jliexpensify (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 Jun 22, 2024

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

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.

@m-natarajan
Copy link
Author

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

@m-natarajan
Copy link
Author

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

@tsa321
Copy link
Contributor

tsa321 commented Jun 23, 2024

Proposal

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

Search - RHP loads infinitely when deleting expense from RHP

What is the root cause of that problem?

New feature: delete from report details. The logic when user deletes expense report from report details will go back to previous screen. I think the correct navigation is to goback to transaction search page.

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

We could make a library function to get previous screen name, something like:

const state = navigationRef.getState();
const previousScreenName = state.routes.at(-1)?.state?.routes?.at(-2)?.name;
// for further details we must check on the routes length; 
// this is used for illustration

In ReportDetailsPage, we can use this library function as getPreviosScreenName.

In here:

onModalHide={() => {
if (!navigateBackToAfterDelete.current) {
return;
}
Navigation.goBack(navigateBackToAfterDelete.current);

Modify the code into:

if (!navigateBackToAfterDelete.current) {
    return;
}

+if (previousScreenName === SCREENS.RIGHT_MODAL.SEARCH_REPORT) {
+    navigateBackToAfterDelete.current = undefined;
+    Navigation.dismissModal();
+    return;
+}
Navigation.goBack(navigateBackToAfterDelete.current);

So we check on previous screen, if it is SCREENS.RIGHT_MODAL.SEARCH_REPORT, we dismiss the modal.


We could use same method in report opened in RHP -> three dots menu -> delete expense.

@mountiny
Copy link
Contributor

@tsa321 do you have a link to the PR that caused this issue?

@tsa321
Copy link
Contributor

tsa321 commented Jun 24, 2024

@mountiny I believe It is new feature. The delete expense button is displayed in report details.
Here is from dev/staging:
Screenshot 2024-06-24 at 18 14 40

Here is from production
Screenshot 2024-06-24 at 18 14 17

I have worked on #43970 and I have tried to revert it, but the problem persists—the loading skeleton view is displayed indefinitely.

I believe the expected behavior is to return to the transaction search page instead of the search report in the RHP, since the report is deleted.

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Jun 24, 2024
@melvin-bot melvin-bot bot changed the title Search - RHP loads infinitely when deleting expense from report details page [$250] Search - RHP loads infinitely when deleting expense from report details page Jun 24, 2024
Copy link

melvin-bot bot commented Jun 24, 2024

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

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

melvin-bot bot commented Jun 24, 2024

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

@mountiny
Copy link
Contributor

Yeah I think the RHP should close and we should remove the expense from the search too cc @luacmartins

@WojtekBoman
Copy link
Contributor

WojtekBoman commented Jun 24, 2024

@tsa321 I checked your proposal and you correctly found a root cause of this issue :)

However, I think that this solution could be a bit more simpler. For example, to determine if we are in the Search tab we can check the topmost central pane route. Thanks to that we have more readable information which module of the app is currently opened:

const topmostCentralPaneRoute = getTopmostCentralPaneRoute(navigationRef.getRootState() as State<RootStackParamList>);

if (!navigateBackToAfterDelete.current) {
    return;
}
+if (topmostCentralPaneRoute?.name === SCREENS.SEARCH.CENTRAL_PANE) {
+    navigateBackToAfterDelete.current = undefined;
+    Navigation.dismissModal();
+    return;
+}
Navigation.goBack(navigateBackToAfterDelete.current);

Furthermore, I noticed that the same logic is used in components: MoneyRequestHeader and MoneyReportHeader. Currently it works this way:

Screen.Recording.2024-06-24.at.14.28.55.mov

After deleting an expense, we're redirected to the ReportScreen, to me it should also close RHP. If so, we can add this logic to header components as well, I think that we can create a separate function to handle that

@yuwenmemon yuwenmemon added DeployBlocker Indicates it should block deploying the API and removed DeployBlocker Indicates it should block deploying the API labels Jun 24, 2024
Copy link

melvin-bot bot commented Jun 25, 2024

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

@luacmartins
Copy link
Contributor

Confirmed this fixed the bug in staging.

@luacmartins luacmartins removed the DeployBlockerCash This issue or pull request should block deployment label Jun 25, 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 Jun 25, 2024
@melvin-bot melvin-bot bot changed the title [$250] Search - RHP loads infinitely when deleting expense from report details page [HOLD for payment 2024-07-02] [$250] Search - RHP loads infinitely when deleting expense from report details page Jun 25, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 25, 2024
Copy link

melvin-bot bot commented Jun 25, 2024

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

Copy link

melvin-bot bot commented Jun 25, 2024

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

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

Copy link

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

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

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

Hi @c3024 - any checklist needed?

@c3024
Copy link
Contributor

c3024 commented Jul 2, 2024

@jliexpensify

This is a new feature and the bug was caught in Staging itself so there is no regression test needed as well. I think there is no need for a checklist here.

@luacmartins
Copy link
Contributor

Correct, we'll add test steps as part of the project wrap up.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 2, 2024
@jliexpensify
Copy link
Contributor

Payment Summary:

Upwork job

@jliexpensify
Copy link
Contributor

Paid and job closed!

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Jul 3, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-07-02] [$250] Search - RHP loads infinitely when deleting expense from report details page [HOLD for payment 2024-07-10] [HOLD for payment 2024-07-02] [$250] Search - RHP loads infinitely when deleting expense from report details page Jul 3, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 3, 2024
Copy link

melvin-bot bot commented Jul 3, 2024

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

Copy link

melvin-bot bot commented Jul 3, 2024

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

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

Copy link

melvin-bot bot commented Jul 3, 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:

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

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

No branches or pull requests

10 participants