Skip to content

[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

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!


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

Activity

  1. added
    Daily
    Bug
    on Aug 22, 2023
  2. melvin-bot commented on Aug 22, 2023

    @melvin-bot

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

  3. melvin-bot commented on Aug 22, 2023

    @melvin-bot

    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
  4. added
    External
    on Aug 23, 2023
  5. melvin-bot commented on Aug 23, 2023

    @melvin-bot
  6. 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[/+] on Aug 23, 2023
  7. added
    Help Wanted
    on Aug 23, 2023
  8. melvin-bot commented on Aug 23, 2023

    @melvin-bot

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

  9. melvin-bot commented on Aug 23, 2023

    @melvin-bot

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

  10. dummy-1111 commented on Aug 24, 2023

    @dummy-1111
    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

  11. lschurr commented on Aug 25, 2023

    @lschurr
    Contributor

    @sobitneupane could you review the proposal here?

  12. 63 remaining items

  13. lschurr commented on Oct 2, 2023

    @lschurr
    Contributor

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

  14. dummy-1111 commented on Oct 2, 2023

    @dummy-1111
    Contributor

    @lschurr

    Offer accepted, thanks

  15. lschurr commented on Oct 2, 2023

    @lschurr
    Contributor

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

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

  16. sobitneupane commented on Oct 4, 2023

    @sobitneupane
    Contributor

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

  17. added
    Weekly
    and removed
    Daily
    on Oct 6, 2023
  18. sobitneupane commented on Oct 9, 2023

    @sobitneupane
    Contributor

    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)

  19. sobitneupane commented on Oct 9, 2023

    @sobitneupane
    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 👎

  20. sobitneupane commented on Oct 9, 2023

    @sobitneupane
    Contributor

    #25727 (comment)

    Requested payment on newDot.

  21. lschurr commented on Oct 9, 2023

    @lschurr
    Contributor

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

  22. JmillsExpensify commented on Oct 9, 2023

    @JmillsExpensify
    Contributor

    $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

Metadata

Metadata

Labels

Awaiting PaymentBugEngineeringExternalWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions