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-02-07] [HOLD for payment 2024-02-05] [$500] Desktop - Unread chat becomes unbolded in LHN without opening unread messages #35254

Closed
1 of 6 tasks
kbecciv opened this issue Jan 26, 2024 · 20 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Jan 26, 2024

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: 1.4.32-2
Reproducible in staging?: y
Reproducible in production?: n
If this was caught during regression testing, add the test name, ID and link from TestRail:
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:

Issue found when executing PR #33779

Action Performed:

Precondition;

  • User A is on web.
  • User B is on desktop app.
  • User A and B windows are next to each other.
  1. [User B Desktop] Open any report other than report with User A.
  2. [User A web] Send a message to User B.
  3. [User B Desktop] Without opening chat with User A, focus the window on the desktop app.

Expected Result:

For User B, the chat with User A will remain bold because User B has not opened the chat with unread message.

Actual Result:

The chat with User A is unbold as soon as User B focuses on the desktop app without even opening chat with User A.
On web, the issue is reproducible when the other user switches between tab without even opening the chat with new message.

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

Bug6355850_1706278998747.20240126_202410.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0108273261b6247483
  • Upwork Job ID: 1750907915767681024
  • Last Price Increase: 2024-01-26
  • Automatic offers:
    • abdulrahuman5196 | Contributor | 28127559
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Jan 26, 2024
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.

Copy link

melvin-bot bot commented Jan 26, 2024

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

@kbecciv
Copy link
Author

kbecciv commented Jan 26, 2024

We think that this bug might be related to #vip-vsb
CC @quinthar

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Jan 26, 2024
@melvin-bot melvin-bot bot changed the title Desktop - Unread chat becomes unbolded in LHN without opening unread messages [$500] Desktop - Unread chat becomes unbolded in LHN without opening unread messages Jan 26, 2024
Copy link

melvin-bot bot commented Jan 26, 2024

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

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

melvin-bot bot commented Jan 26, 2024

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

@mountiny
Copy link
Contributor

Making this external none of the PRs in checklist stand out to me. Anyone can find which pr caused this?

@mountiny
Copy link
Contributor

I am out for couple hours

@bernhardoj
Copy link
Contributor

It's caused by #34537 where we read the newest action on visibility change. I think we should return early if the report screen on the stack isn't focused.

@tienifr
Copy link
Contributor

tienifr commented Jan 26, 2024

This is regression from #34537, I can raise a PR immediately if assigned

Proposal

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

The chat with User A is unbold as soon as User B focuses on the desktop app without even opening chat with User A.
On web, the issue is reproducible when the other user switches between tab without even opening the chat with new message.

What is the root cause of that problem?

In here, we do not check that the current report has focus/is the topmost one before marking it as read, so even when the report is not the topmost one, it's still marked as read when the visibility changes.

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

We should unsubscribeVisibilityListener if the report is not focused/is not the topmost report. For example we can update this to:

const isFocused = useIsFocused();

useEffect(() => {
    if (!isFocused) {
        return;
    }

    const unsubscribeVisibilityListener = Visibility.onVisibilityChange(onVisibilityChange);
    return unsubscribeVisibilityListener;
}, [onVisibilityChange, isFocused]);

This will fix the issue and there'll be no redundant event listeners for not-focused reports

What alternative solutions did you explore? (Optional)

NA

@thesahindia
Copy link
Member

thesahindia commented Jan 26, 2024

It's caused by #34537 where we read the newest action on visibility change. I think we should return early if the report screen on the stack isn't focused.

cc: @FitseTLT @abdulrahuman5196 @hayata-suenaga

@arosiclair
Copy link
Contributor

I also have this blocker which seems like it has the same root cause: #35251

Do we know if the proposed solutions can fix both?

@tienifr
Copy link
Contributor

tienifr commented Jan 27, 2024

Do we know if the proposed solutions can fix both?

@arosiclair Yes, it's same root cause and my proposed solution will fix both (tested).

Copy link

melvin-bot bot commented Jan 28, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@abdulrahuman5196
Copy link
Contributor

#35251 and #35254 are same issue. (We can combine into one issue if required). Since its under the regression period @FitseTLT Should fix this. Kindly assign me as C+ as well.
On another topic @tienifr 's proposal here #35254 (comment) works fine.

@melvin-bot melvin-bot bot added the Overdue label Jan 28, 2024
@FitseTLT
Copy link
Contributor

Raised PR for these and linked to the original issue 👍

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 28, 2024
@melvin-bot melvin-bot bot removed the Overdue label Jan 28, 2024
Copy link

melvin-bot bot commented Jan 28, 2024

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

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 Weekly KSv2 labels Jan 29, 2024
@mountiny mountiny removed the DeployBlockerCash This issue or pull request should block deployment label Jan 29, 2024
@mountiny
Copy link
Contributor

Reverted the offending PR

@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 29, 2024
@melvin-bot melvin-bot bot changed the title [$500] Desktop - Unread chat becomes unbolded in LHN without opening unread messages [HOLD for payment 2024-02-05] [$500] Desktop - Unread chat becomes unbolded in LHN without opening unread messages Jan 29, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 29, 2024
Copy link

melvin-bot bot commented Jan 29, 2024

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

Copy link

melvin-bot bot commented Jan 29, 2024

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

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

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jan 31, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-02-05] [$500] Desktop - Unread chat becomes unbolded in LHN without opening unread messages [HOLD for payment 2024-02-07] [HOLD for payment 2024-02-05] [$500] Desktop - Unread chat becomes unbolded in LHN without opening unread messages Jan 31, 2024
Copy link

melvin-bot bot commented Jan 31, 2024

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

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

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

8 participants