Skip to content

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

Closed

Description

@lanitochka17

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

Activity

  1. melvin-bot commented on Mar 29, 2024

    @melvin-bot

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

  2. github-actions commented on Mar 29, 2024

    @github-actions
    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.
  3. lanitochka17 commented on Mar 29, 2024

    @lanitochka17
    Author

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

  4. lanitochka17 commented on Mar 29, 2024

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

  5. luacmartins commented on Apr 1, 2024

    @luacmartins
    Contributor

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

  6. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Apr 1, 2024
  7. 5 remaining items

  8. melvin-bot commented on Apr 1, 2024

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 1, 2024
  10. melvin-bot commented on Apr 1, 2024

    @melvin-bot

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

  11. melvin-bot commented on Apr 1, 2024

    @melvin-bot

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

  12. abzokhattab commented on Apr 1, 2024

    @abzokhattab
    Contributor

    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
  13. hungvu193 commented on Apr 2, 2024

    @hungvu193
    Contributor

    @abzokhattab Can you reproduce on latest main now?

    Screen.Recording.2024-04-02.at.09.48.33.mov
  14. abzokhattab commented on Apr 2, 2024

    @abzokhattab
    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
  15. hungvu193 commented on Apr 2, 2024

    @hungvu193
    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 :/

  16. abzokhattab commented on Apr 2, 2024

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

  17. hungvu193 commented on Apr 2, 2024

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

  18. joekaufmanexpensify commented on Apr 2, 2024

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions