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.5k stars 2.85k forks source link

[$250] mWeb - Debug - In workspace chat, delete via debug directs to blank page. #51388

Open IuliiaHerets opened 2 days ago

IuliiaHerets commented 2 days 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: 9.0.53-0 Reproducible in staging?: Y Reproducible in production?: Unable to check in Prod, Debug mode is not available Issue reported by: Applause Internal Team

Action Performed:

Pre-condition: 1.Go to https://staging.new.expensify.com/home

  1. Go to profile icon -- troubleshoot

  2. Scroll down to enable debug mode

  3. Go to https://staging.new.expensify.com/home

  4. Tap on a workspace chat

  5. Send a message

  6. Tap header -- debug

  7. Scroll down to tap delete

  8. Note a blank page displayed

  9. Refresh the page

  10. Note hmm not here page displayed

  11. Navigate to LHN

  12. Note report disappeared from LHN

Expected Result:

In workspace chat, delete via debug must not direct to blank page.

Actual Result:

In workspace chat, delete via debug directs to blank page initially and on refresh directs to hmm not here. Then navigating to LHN, particular report is not shown.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/02014ea0-2158-4623-b9ca-eea79799b3f7

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021849364084876247061
  • Upwork Job ID: 1849364084876247061
  • Last Price Increase: 2024-10-24
Issue OwnerCurrent Issue Owner: @alitoshmatov
melvin-bot[bot] commented 2 days ago

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

melvin-bot[bot] commented 2 days ago

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.

melvin-bot[bot] commented 2 days ago

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

github-actions[bot] commented 2 days ago

:wave: 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.
lakchote commented 2 days ago

Not a blocker, it concerns an issue with Debug mode. It also concerns Web as a whole.

melvin-bot[bot] commented 2 days ago

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

melvin-bot[bot] commented 2 days ago

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

nyomanjyotisa commented 2 days ago

Proposal

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

mWeb - Debug - In workspace chat, delete via debug directs to blank page.

What is the root cause of that problem?

We use Navigation.goBack(); after the delete action https://github.com/Expensify/App/blob/45cabbfd877234921be4439a7c9c922f6a45a581/src/pages/Debug/DebugDetails.tsx#L233-L241

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

Use Navigation.dismissModal(); instead

What alternative solutions did you explore? (Optional)

NJ-2020 commented 2 days ago

Edited by proposal-police: This proposal was edited at 2024-10-24 12:34:01 UTC.

Proposal

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

mWeb - Debug - In workspace chat, delete via debug directs to blank page

What is the root cause of that problem?

When clicking the delete the report, we only navigating back from the report which will only dismiss the modal https://github.com/Expensify/App/blob/45cabbfd877234921be4439a7c9c922f6a45a581/src/pages/Debug/DebugDetails.tsx#L237-L240

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

We need to add the Navigation.dismissModal(); too And we will run the goBack function if it's small screen width

Navigation.dismissModal();
if (isSmallScreenWidth) {
    Navigation.isNavigationReady().then(() => {
        Navigation.goBack();
    })
}

Result

https://github.com/user-attachments/assets/2ab0ff2d-12f9-49c6-859d-9e28dc42fb65

What alternative solutions did you explore? (Optional)

bernhardoj commented 2 days ago

Proposal

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

After deleting report from debug page, a blank page is shown.

What is the root cause of that problem?

When we press delete, it will delete the report and go back to the previous page. The previous page in our case is the report details page. The report details page is wrapped with a withReportOrNotFound HOC. In the HOC, if shouldShowNotFoundPage is true (because the report is empty) and contentShown ref is true, we render nothing. https://github.com/Expensify/App/blob/bb4e3e45586aa63e027972da29ebc125b56ea05e/src/pages/home/report/withReportOrNotFound.tsx#L86-L90

The comment mentions why we do that. Basically, if the report is previously available but now is not, we assume that the page will be dismissed along with the deletion and we don't want to show not found page while navigating back. However, that is not the case when we delete it from the debug page.

Also, that's not the case if say:

  1. User A invite user B to a room
  2. User B open the room details page
  3. User A removes B from room
  4. User B sees blank page

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

Because we don't want to show the not found briefly when navigating back, we can check for the screen focused state instead. https://github.com/Expensify/App/blob/bb4e3e45586aa63e027972da29ebc125b56ea05e/src/pages/home/report/withReportOrNotFound.tsx#L86-L90

if (shouldShowNotFoundPage && !isFocused) {
    return null;
}
NJ-2020 commented 2 days ago

Proposal Updated

lakchote commented 1 day ago

@alitoshmatov please review proposals, thank you.