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

[$500] IOU - Chat reloads when clicking Message <user> after returning from IOU thread #39289

Closed
6 tasks done
lanitochka17 opened this issue Mar 29, 2024 · 15 comments
Closed
6 tasks done
Assignees
Labels
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 Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Mar 29, 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.58-1
Reproducible in staging?: Y
Reproducible in production?: N
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. Request money from any user
  3. In 1:1 DM, click on the IOU preview
  4. Click on the header subtitle to return to 1:1 DM
  5. In 1:1 DM, click on the chat header
  6. Click Message

Expected Result:

Chat will not reload when clicking Message since it will lead to the same page

Actual Result:

Chat reloads when clicking Message after returning from thread

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

Add any screenshot/video evidence

Bug6431952_1711738623625.bandicam_2024-03-30_02-52-11-679.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01350a160bfffaa30f
  • Upwork Job ID: 1774830354063110144
  • Last Price Increase: 2024-04-01
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Mar 29, 2024
Copy link

melvin-bot bot commented Mar 29, 2024

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

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp

@lanitochka17
Copy link
Author

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

@melvin-bot melvin-bot bot added the Overdue label Apr 1, 2024
@luacmartins
Copy link
Contributor

I'll demote this to NAB, but it's something we need to fix. Making it external.

@melvin-bot melvin-bot bot removed the Overdue label Apr 1, 2024
@luacmartins luacmartins added Daily KSv2 Overdue and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Apr 1, 2024
@melvin-bot melvin-bot bot removed the Overdue label Apr 1, 2024
@luacmartins luacmartins added Overdue Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor labels Apr 1, 2024
@melvin-bot melvin-bot bot changed the title IOU - Chat reloads when clicking Message <user> after returning from IOU thread [$500] IOU - Chat reloads when clicking Message <user> after returning from IOU thread Apr 1, 2024
Copy link

melvin-bot bot commented Apr 1, 2024

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

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

melvin-bot bot commented Apr 1, 2024

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

Copy link

melvin-bot bot commented Apr 1, 2024

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

@abzokhattab
Copy link
Contributor

abzokhattab commented Apr 1, 2024

Proposal

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

app reloads when clicking on message while the user report being open in the background

What is the root cause of that problem?

on clicking on Message <user> we navigate and open the report of that user without checking whether we are on the report page or not

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

we should just dismiss the modal incase the target report is open in the background:

to achieve that, we should pass the current reportID to the ReportActions.navigateToAndOpenReportWithAccountIDs

onPress={() => ReportActions.navigateToAndOpenReportWithAccountIDs([accountID])}

onPress={() => ReportActions.navigateToAndOpenReportWithAccountIDs([accountID], report?.reportID)}

and then check if the reportID is the same or not before opening the report in this line

openReport(report.reportID, '', [], newChat, '0', false, participantAccountIDs);

function navigateToAndOpenReportWithAccountIDs(participantAccountIDs: number[], currentReportID?: string) {
    let newChat: ReportUtils.OptimisticChatReport | EmptyObject = {};
    const chat = ReportUtils.getChatByParticipants(participantAccountIDs);
    if (!chat) {
        newChat = ReportUtils.buildOptimisticChatReport(participantAccountIDs);
    }
    const report = chat ?? newChat;

    if (currentReportID && report.reportID !== currentReportID) {
        // We want to pass newChat here because if anything is passed in that param (even an existing chat), we will try to create a chat on the server
        openReport(report.reportID, '', [], newChat, '0', false, participantAccountIDs);
    }
    Navigation.dismissModalWithReport(report);
}

POC

Screen.Recording.2024-04-01.at.7.49.53.PM.mov

@hungvu193
Copy link
Contributor

@abzokhattab Can you reproduce on latest main now?

Screen.Recording.2024-04-02.at.09.48.33.mov

@abzokhattab
Copy link
Contributor

abzokhattab commented Apr 2, 2024

yes still reproducible

it doesnt reload but it keeps sending OpenReport request to the backend

Screen.Recording.2024-04-02.at.4.56.03.AM.mov

@hungvu193
Copy link
Contributor

yes still reproducible

it doesnt reload but it keeps sending OpenReport request to the backend

Screen.Recording.2024-04-02.at.4.56.03.AM.mov

Can you declare your test steps? It seems working fine on my end :/

@abzokhattab
Copy link
Contributor

Yes, it doesn't reload as shown in the video but it sends a redundant backend request openReport as observed in the network tap.

To reproduce the previous behavior:

  1. open a chat with any user.
  2. send a message in case you don't have any previous chat with this user.
  3. click on the report header
  4. Then click on "Message XXXX"

This raises the question: Do we actually need to display the "Message XXX" item if the report is already opened in the background? I believe it's redundant in this case because it's already open.

@hungvu193
Copy link
Contributor

I'm observing the same behavior across dev, staging, and prod; it calls OpenReport when we click the Message ... button. Given that information, I think we can close this issue.

@joekaufmanexpensify
Copy link
Contributor

Yeah, I think it's fine that we display this even if the report is open in the background (as long as it's working, which it sounds like it is). Closing for now, but LMK if anyone disagrees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

5 participants