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] LHN - Сonversation is not displayed in bold when new messages are received #27038

Closed
1 of 6 tasks
lanitochka17 opened this issue Sep 8, 2023 · 22 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 8, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Open a New Expensify app
  2. Log in using any login A
  3. Navigate to the concierge conversation
  4. Open https://staging.new.expensify.com/
    in your browser
  5. Log in using any login B
  6. Send a message from user B to user A
  7. Under user A in the application, navigate to Settings/Preferences
  8. Activate the "Force offline" mode
  9. Send a message from user B to user A
  10. Deactivate the "Force offline" mode
  11. Focus on the conversation with the concierge

Expected Result:

When receiving new messages when exiting offline mode, the conversation name should become bold in the LHN

Actual Result:

When receiving new messages when leaving offline mode, the conversation is not displayed in bold in LHN

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.66-1

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Notes/Photos/Videos: Any additional supporting documentation

Recording.199.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01005d8dd45f8b4890
  • Upwork Job ID: 1700237159903662080
  • Last Price Increase: 2023-09-08
  • Automatic offers:
    • tienifr | Contributor | 26684669
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@abekkala abekkala added the External Added to denote the issue can be worked on by a contributor label Sep 8, 2023
@melvin-bot melvin-bot bot changed the title LHN - Сonversation is not displayed in bold when new messages are received [$500] LHN - Сonversation is not displayed in bold when new messages are received Sep 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 2023

Current assignee @abekkala is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 2023

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

@allroundexperts
Copy link
Contributor

allroundexperts commented Sep 8, 2023

As @Santhosh-Sellavel is OoO for couple of weeks, I can take this over!

@tienifr
Copy link
Contributor

tienifr commented Sep 10, 2023

Proposal

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

When receiving new messages when leaving offline mode, the conversation is not displayed in bold in LHN

What is the root cause of that problem?

In this line, we're checking if current report is visible, if yes we call openReport on it. The problem is if we ever opened the report before (but we already switched to another report), isTopMostReportId will be true. Because that value is calculated at the time that report is opened here, and never changes once another report goes on top. It's a regression from this PR where we migrate the ReportScreen to functional component, before that change, the isTopMostReportId is always recalculated inside the listener.

This leads to, when we go back to the report after sending messages from another tab, it calls openReport on the not-on-top report, causing the incoming new messages to be read immediately and the bold style does not show (because it only shows for unread report here.

Meanwhile, if we send new messages from another device, without changing the visibility of the current tab. The bold style will show normally because the openReport is not run in that case.

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

We can make isTopMostReportId a function to make sure it's evaluated any time the listener run. This is the same logic as we have previously, before the migration to functional component.

  1. Update here to
const isTopmostReportId = () => Navigation.getTopmostReportId() === getReportID(route);
  1. Use that function here
if (!getIsReportFullyVisible(isTopMostReportId()) || report.isOptimisticReport) {
  1. Use it here as well

What alternative solutions did you explore? (Optional)

We can make isTopMostReportId a dependency of the useEffect that registers the listener here, but I'm not sure we want that since it will reregister the listener any time the topmost report changes.

Another potential solution is to add the visibility listener only when the report is topmost report or it's optimistic report, if that is no longer true, we'll remove the listener because it doesn't make sense any more to listen to the visibility change in that case, since we'll early return here already.

@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@abekkala
Copy link
Contributor

@allroundexperts have you had a chance to review the proposal?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 11, 2023
@melvin-bot melvin-bot bot removed Help Wanted Apply this label when an issue is open to proposals by contributors Overdue labels Sep 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

📣 @allroundexperts Please request via NewDot manual requests for the Contributor role ($500)

@abekkala
Copy link
Contributor

@allroundexperts friendly bump on reviewing the Proposal that has been provided :)

@allroundexperts
Copy link
Contributor

@tienifr's proposal looks good to me. It has the correct RCA and proposes a working solution as well.

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

Triggered auto assignment to @hayata-suenaga, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

📣 @allroundexperts Please request via NewDot manual requests for the Reviewer role ($500)

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

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

@tienifr
Copy link
Contributor

tienifr commented Sep 15, 2023

@hayata-suenaga @allroundexperts This issue is no longer reproducible, it has been fixed via this PR (which fixes another issue that has similar root cause). So I think we can close this one.

@melvin-bot melvin-bot bot added the Overdue label Sep 18, 2023
@abekkala
Copy link
Contributor

@hayata-suenaga do you agree we can just close this issue out?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 18, 2023
@hayata-suenaga
Copy link
Contributor

@allroundexperts could you double check on this comment?

@melvin-bot melvin-bot bot removed the Overdue label Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

@abekkala @allroundexperts @hayata-suenaga @tienifr this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@abekkala
Copy link
Contributor

@allroundexperts can you please confirm the above?

@melvin-bot melvin-bot bot added the Overdue label Sep 27, 2023
@abekkala
Copy link
Contributor

@allroundexperts can you please address the comment above (#27038 (comment)?)?

cc: @hayata-suenaga

@melvin-bot melvin-bot bot removed the Overdue label Sep 28, 2023
@allroundexperts
Copy link
Contributor

That's accurate @abekkala. Let's close this!

@hayata-suenaga
Copy link
Contributor

bumped @allroundexperts in slack

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

No branches or pull requests

6 participants