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 2023-08-07] [HOLD for payment 2023-08-03] Unread not working on the LHN #23446

Closed
1 of 6 tasks
kavimuru opened this issue Jul 23, 2023 · 24 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@kavimuru
Copy link

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 2 accounts on 2 browsers
  2. Both account open the chat
  3. B send any message
  4. B click another report
  5. A send the message, Observed in report B not marked as unread on LHN

Expected Result:

in report B marked as unread on LHN, when B does not open the report

Actual Result:

in report B not marked as unread on LHN

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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.44-0
Reproducible in staging?: y
Reproducible in production?: y
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

Screen.Recording.2023-07-23.at.21.28.58.mov
Recording.1328.mp4

Expensify/Expensify Issue URL:
Issue reported by: @namhihi237
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690006349415999

View all open jobs on GitHub

@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 23, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 23, 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

@StevenKKC
Copy link
Contributor

StevenKKC commented Jul 24, 2023

Proposal

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

Unread not working on the LHN.

What is the root cause of that problem?

If user B received a message from user A, the following code is executed, and then calculate new marker actions.
If the scroll position is 0, then call Report.readNewestAction in order to update report's lastReadTime.

unsubscribeFromNewActionEvent.current = Report.subscribeToNewActionEvent(props.report.reportID, (isFromCurrentUser, newActionID) => {
const isNewMarkerReportActionIDSet = !_.isEmpty(newMarkerReportActionID);
// If a new comment is added and it's from the current user scroll to the bottom otherwise leave the user positioned where
// they are now in the list.
if (isFromCurrentUser) {
reportScrollManager.scrollToBottom();
// If the current user sends a new message in the chat we clear the new marker since they have "read" the report
setNewMarkerReportActionID('');
} else if (isReportFullyVisible) {
// We use the scroll position to determine whether the report should be marked as read and the new line indicator reset.
// If the user is scrolled up and no new line marker is set we will set it otherwise we will do nothing so the new marker
// stays in it's previous position.
if (currentScrollOffset.current === 0) {
Report.readNewestAction(props.report.reportID);
setNewMarkerReportActionID('');
} else if (!isNewMarkerReportActionIDSet) {
// The report is not in view and we received a comment from another user while the new marker is not set
// so we will set the new marker now.
setNewMarkerReportActionID(newActionID);
}
} else if (!isNewMarkerReportActionIDSet) {
setNewMarkerReportActionID(newActionID);
}
});

In this issue, user B already navigates to another report, but previous report view is not unmounted, and still receive push event.
So when receive new action, Report.readNewestAction is called, and lastReadTime is updated.
Therefore, previous report does not marked as unread in LHN.

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

We should add checking whether the report is visible (i.e. the current report) in new action event handler as below.

    unsubscribeFromNewActionEvent.current = Report.subscribeToNewActionEvent(props.report.reportID, (isFromCurrentUser, newActionID) => {
+       if (Navigation.getTopmostReportId() === props.report.reportID) {
+           return;
+       }

What alternative solutions did you explore? (Optional)

None.

@stephanieelliott
Copy link
Contributor

stephanieelliott commented Jul 24, 2023

Hey @kavimuru can you please clarify the on the repro steps? I'm not sure I understand how to test this:

  1. Open 2 accounts on 2 browsers
  • I open Account A on Chrome, and Account B on Safari
  1. Both account open the chat
  • On Account A I navigate to chat with Account B, on Account B I navigate to chat with Account A
  1. B send any message
  • On Account B I send a message to Account A
  1. B click another report
  • What does this mean -- on Account B should I be clicking into a chat with a separate user (Account X?) If no, what navigation steps should I be following?
  1. A send the message, Observed in report B not marked as unread on LHN
  • On Account A I send a message to Account B. Is the expectation that Account B sees this chat as unread?

@namhihi237
Copy link
Contributor

Hi @stephanieelliott , All steps as you mention with step 4, I think you can click chat with Concierge. if not you can create any other report before.
Expectation: Account B sees this chat as unread on LHN => yes

@mountiny mountiny added the Reviewing Has a PR in review label Jul 27, 2023
@mountiny mountiny self-assigned this Jul 27, 2023
@mountiny mountiny removed the Reviewing Has a PR in review label Jul 27, 2023
@mountiny
Copy link
Contributor

This was a fire and Hanno has been working on fixing it, pr is raised

@hannojg
Copy link
Contributor

hannojg commented Jul 27, 2023

👋

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Jul 27, 2023
@melvin-bot melvin-bot bot changed the title Unread not working on the LHN [HOLD for payment 2023-08-03] Unread not working on the LHN Jul 27, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.46-2 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 2023-08-03. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

  • @hannojg does not require payment (Contractor)

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@mountiny] The PR that introduced the bug has been identified. Link to the PR:
  • [@mountiny] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@mountiny] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@hannojg] Determine if we should create a regression test for this bug.
  • [@hannojg] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@stephanieelliott] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 31, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-08-03] Unread not working on the LHN [HOLD for payment 2023-08-07] [HOLD for payment 2023-08-03] Unread not working on the LHN Jul 31, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 31, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.47-6 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 2023-08-07. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

  • @hannojg does not require payment (Contractor)

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jul 31, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@mountiny] The PR that introduced the bug has been identified. Link to the PR:
  • [@mountiny] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@mountiny] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@hannojg] Determine if we should create a regression test for this bug.
  • [@hannojg] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@stephanieelliott] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@mountiny
Copy link
Contributor

mountiny commented Aug 1, 2023

We will have to make a regression test for this @namhihi237 Are you able to suggest one please?

@namhihi237
Copy link
Contributor

Sure @mountiny

Regression Test Steps

  1. Open 2 accounts on 2 browsers (2 accounts don't have a previous chat)
  2. Both accounts open the chat together
  3. Account B send any message
  4. B click and open another report on LHN
  5. A send the message, from B to verify that the report display is unread on LHN with user A

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Aug 3, 2023
@mountiny
Copy link
Contributor

mountiny commented Aug 6, 2023

Thanks! @stephanieelliott could we add this as a regression test please?

@stephanieelliott
Copy link
Contributor

Issue for regression test here: https://github.com/Expensify/Expensify/issues/306359

@stephanieelliott
Copy link
Contributor

Seems like no payment is due on this issue since it was a regression? Will leave this open for comment for one more day in case payment needs to be made.

@namhihi237
Copy link
Contributor

namhihi237 commented Aug 8, 2023

@stephanieelliott i am a reporter but seem i dont have any bonus for this issue? Cc @mountiny

@stephanieelliott
Copy link
Contributor

Thanks @namhihi237, extended the offer to you in Upwork.

Summarizing payment on this issue:

  • Issue reporter: $250 @namhihi237, payment in Upwork
  • Contributor: N/A, expert contrib
  • Contributor+: N/A, regression

Upwork job is here https://www.upwork.com/jobs/~01256709c3bd79ab23

@namhihi237
Copy link
Contributor

Accepted, thanks @stephanieelliott

@namhihi237
Copy link
Contributor

Hi @stephanieelliott any update for this.

@namhihi237
Copy link
Contributor

Bump on this @stephanieelliott . I see the issue was closed.

@stephanieelliott
Copy link
Contributor

Thanks for the reminder and sorry for the delay @namhihi237, I issued your payment in Upwork!

@namhihi237
Copy link
Contributor

Thanks @stephanieelliott

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 Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
None yet
Development

No branches or pull requests

6 participants