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-09-29] [$1000] Task - Chat report for task assignee disappears from LHN when logged in on a different session #25727

Closed
3 of 6 tasks
lanitochka17 opened this issue Aug 22, 2023 · 52 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 22, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Go to staging.new.expensify,com
  2. Create new account A & B on web browser.
  3. As User A, initiate a chat with User B.
  4. As User A, assign a task to to User A but share it in User B's chat.
  5. As User A, complete the task.
  6. As User B on web browser, verify that the new chat from User A exists, log out while leaving the chat unread (don't open it).
  7. As User B, log in on a different platform like mweb, Android or desktop app. If using web, please clear the browser session entirely (close and reopen incognito window)

Expected Result:

Chat report from User A will remain in LHN

Actual Result:

Chat report from User A disappears from LHN when logged in on a different session

Workaround:

Unknown

Platforms:

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

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

Version Number: 1.3.56-7

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

Bug6173876_bandicam_2023-08-23_03-38-12-587.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/~0179eb890f49bf0a87
  • Upwork Job ID: 1694471428963811328
  • Last Price Increase: 2023-09-06
  • Automatic offers:
    • s-alves10 | Contributor | 26687142
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 22, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 22, 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

@lschurr lschurr added the External Added to denote the issue can be worked on by a contributor label Aug 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0179eb890f49bf0a87

@melvin-bot melvin-bot bot changed the title Task - Chat report for task assignee disappears from LHN when logged in on a different session [$1000] Task - Chat report for task assignee disappears from LHN when logged in on a different session Aug 23, 2023
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

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

@dummy-1111
Copy link
Contributor

Proposal

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

Chat report for task assignee disappears from LHN when log in on another device

What is the root cause of that problem?

Suppose that user A opens a new chat with user B.
When user A sends message or does some actions like create task, user B receives pusher events for those actions and so user B would have report actions for that report(chat between user A and user B). But when a user log out and log in again, we call openApp or reconnectApp API but these APIs doesn't return actions of the report that the user haven't ever visited. So in this case, the report actions of the new chat would be empty

This makes the new report filtered out by the below line when getting LHN list

const isEmptyChat = !lastVisibleMessage.lastMessageText && !lastVisibleMessage.lastMessageTranslationKey;

App/src/libs/ReportUtils.js

Lines 2646 to 2648 in 329cac3

if (excludeEmptyChats && isEmptyChat && isChatReport(report) && !isChatRoom(report) && !isPolicyExpenseChat(report)) {
return false;
}

This is the root cause

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

We determines if the report is empty by checking the last visible action of the report below

App/src/libs/ReportUtils.js

Lines 2616 to 2617 in 329cac3

const lastVisibleMessage = ReportActionsUtils.getLastVisibleMessage(report.reportID);
const isEmptyChat = !lastVisibleMessage.lastMessageText && !lastVisibleMessage.lastMessageTranslationKey;

We have the same data in the report(lastMessageText and lastMessageTranslationKey)
We can do the check by using the report

        const isEmptyChat = !report.lastMessageText && !report.lastMessageTranslationKey;

This works fine as expected

What alternative solutions did you explore? (Optional)

We can check if the report is empty by using both report and last visible action. But I think checking by report is enough

@melvin-bot melvin-bot bot added the Overdue label Aug 25, 2023
@lschurr
Copy link
Contributor

lschurr commented Aug 25, 2023

@sobitneupane could you review the proposal here?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Aug 25, 2023
@sobitneupane
Copy link
Contributor

I will review the proposals today.

@melvin-bot melvin-bot bot removed the Overdue label Aug 28, 2023
@sobitneupane
Copy link
Contributor

Thanks for the proposal @s-alves10.

these APIs doesn't return actions of the report that the user haven't ever visited.

In that case, should we update API to return those actions?

We have the same data in the report(lastMessageText and lastMessageTranslationKey)

I don't think it is always the case. The change will be prone to regression. lastVisibleAction also includes actionsToMerge and considers different situation if we dig into ReportActionsUtils.getLastVisibleMessage. Will we have to worry about those cases?

@dummy-1111
Copy link
Contributor

dummy-1111 commented Aug 29, 2023

@sobitneupane

We can safely do this IMO. Please check all the callers of ReportActionsUtils.getLastVisibleMessage function. actionsToMerge is the optmistic data and used to get lastMessageText of that report. And as you can see here, we check the lastMessageText of the report first when getting the last message

@lschurr lschurr removed the Bug Something is broken. Auto assigns a BugZero manager. label Aug 30, 2023
@lschurr lschurr removed their assignment Aug 30, 2023
@lschurr lschurr added the Bug Something is broken. Auto assigns a BugZero manager. label Aug 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

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

@Expensify Expensify deleted a comment from melvin-bot bot Aug 30, 2023
@lschurr
Copy link
Contributor

lschurr commented Aug 30, 2023

Hi @greg-schroeder - I'm heading OOO until Sept 6th so I'm adding the BZ label here. I'll grab it back from you when I return!

@lschurr lschurr self-assigned this Aug 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 22, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Task - Chat report for task assignee disappears from LHN when logged in on a different session [HOLD for payment 2023-09-29] [$1000] Task - Chat report for task assignee disappears from LHN when logged in on a different session Sep 22, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.72-11 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-09-29. 🎊

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:

  • @sobitneupane does not require payment (Eligible for Manual Requests)
  • @s-alves10 requires payment offer (Contributor)

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 Sep 22, 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:

  • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:
  • [@sobitneupane] 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:
  • [@sobitneupane] 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:
  • [@sobitneupane] Determine if we should create a regression test for this bug.
  • [@sobitneupane] 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.
  • [@lschurr] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@lschurr
Copy link
Contributor

lschurr commented Sep 27, 2023

Hi @sobitneupane - could you work on the checklist for this one?

@lschurr
Copy link
Contributor

lschurr commented Sep 28, 2023

Payment summary:

  • Bug reporter: Applause (no payment)
  • Contributor: @s-alves10 $1500
  • Contributor+: @sobitneupane $1500

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Sep 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

@danieldoglas, @sobitneupane, @lschurr, @s-alves10 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@lschurr
Copy link
Contributor

lschurr commented Oct 2, 2023

@s-alves10 could you accept the offer in Upwork?

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@lschurr
Copy link
Contributor

lschurr commented Oct 2, 2023

@sobitneupane could you work on the checklist for this one?

@dummy-1111
Copy link
Contributor

@lschurr

Offer accepted, thanks

@lschurr
Copy link
Contributor

lschurr commented Oct 2, 2023

Great - payment sent in Upwork to @s-alves10.

We can close this out once the checklist is complete @sobitneupane

@sobitneupane
Copy link
Contributor

Sorry for the delay. I will work on the checklist before the weekend.

@melvin-bot melvin-bot bot added the Overdue label Oct 6, 2023
@danieldoglas danieldoglas added Weekly KSv2 and removed Daily KSv2 labels Oct 6, 2023
@melvin-bot melvin-bot bot removed the Overdue label Oct 6, 2023
@sobitneupane
Copy link
Contributor

sobitneupane commented Oct 9, 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:

  • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:

#19321

  • [@sobitneupane] 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:

The PR was not solely responsible for the issue. Task Reports were newly introduced back then and was not considered in the PR.

  • [@sobitneupane] 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:

It's an edge case which can easily miss during PR review.

  • [@sobitneupane] Determine if we should create a regression test for this bug.

Yes.

  • [@sobitneupane] 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.

#25727 (comment)

@sobitneupane
Copy link
Contributor

Regression Test Proposal

  1. Open ND and log in with account A and account B on different browsers
  2. As account A, initiate a new chat with account B
  3. As account A, assign a task to account A and share it in the chat with account B
  4. As account A, complete the task
  5. Verify that account B can see the new chat with account A
  6. As account B, log out while leaving the chat unread(don't open it)
  7. As account B, log in on a different platform(mweb, native, desktop, or incognito web)
  8. Verify that the new chat with account A remains in LHN

Do we agree 👍 or 👎

@sobitneupane
Copy link
Contributor

#25727 (comment)

Requested payment on newDot.

@lschurr
Copy link
Contributor

lschurr commented Oct 9, 2023

Great! I've added the QA test request. Closing.

@lschurr lschurr closed this as completed Oct 9, 2023
@JmillsExpensify
Copy link

$1,500 payment approved for @sobitneupane based on BZ summary.

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