Skip to content

[HOLD for payment 2024-08-09] [$250] Draft disappears from the LHN when clicking away after starting a thread #45543

Closed

Description

@m-natarajan

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


Version Number: 9.0.8-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
Expensify/Expensify Issue URL:
Issue reported by: @rafecolton
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1721142729468189

Action Performed:

  1. Create a group as user A with user B and user C
  2. Send a message to group as user A
  3. Start a thread as user B
  4. Without joining click away

Expected Result:

Draft should stay in the LHN

Actual Result:

Draft disappear from the LHN

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

Recording.345.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011241d6b36d075893
  • Upwork Job ID: 1815808765453560667
  • Last Price Increase: 2024-07-23
  • Automatic offers:
    • mkhutornyi | Reviewer | 103252123
    • nkdengineer | Contributor | 103252124
Issue OwnerCurrent Issue Owner: @abekkala

Activity

  1. added
    Daily
    Bug
    on Jul 17, 2024
  2. melvin-bot commented on Jul 17, 2024

    @melvin-bot

    Triggered auto assignment to @abekkala (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. nkdengineer commented on Jul 17, 2024

    @nkdengineer
    Contributor

    Proposal

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

    Draft disappear from the LHN

    What is the root cause of that problem?

    The thread report has notificationPreference as hidden. If we don't open this thread or this thread is not pinned, it's hidden in LHN because we return early here.

    const shouldOverrideHidden = hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned;

    if (isHidden && !shouldOverrideHidden) {
    return;
    }

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

    If the report has a draft comment shouldOverrideHidden should be true. We should use hasValidDraftComment to check whether the report has a draft comment or not.

    const shouldOverrideHidden = hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned || hasValidDraftComment(report.reportID);
    

    const shouldOverrideHidden = hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned;

    Then the check shouldReportBeInOptionList can be called and everything works well because we already have the check for draft comment in this function

    https://github.com/Expensify/App/blob/9c509a0e6363adaeb6cbb8c377ed6ff98b85dc65/src/libs/ReportUtils.ts#L5486-5487

    What alternative solutions did you explore? (Optional)

    We can return early if the report has a draft comment before this line

    if (hasValidDraftComment(report.reportID)) {
        reportsToDisplay.push(report);
        return;
    }
    

    const shouldOverrideHidden = hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned;

  4. melvin-bot commented on Jul 22, 2024

    @melvin-bot

    @abekkala Huh... This is 4 days overdue. Who can take care of this?

  5. added
    External
    on Jul 23, 2024
  6. changed the title [-]Draft disappears from the LHN when clicking away after starting a thread[/-] [+][$250] Draft disappears from the LHN when clicking away after starting a thread[/+] on Jul 23, 2024
  7. melvin-bot commented on Jul 23, 2024

    @melvin-bot
  8. added
    Help Wanted
    on Jul 23, 2024
  9. melvin-bot commented on Jul 23, 2024

    @melvin-bot

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

  10. mkhutornyi commented on Jul 24, 2024

    @mkhutornyi

    @nkdengineer's proposal looks good to me. I like main solution.
    🎀👀🎀 C+ reviewed

  11. 12 remaining items

  12. added
    Awaiting Payment
    on Aug 2, 2024
  13. changed the title [-][$250] Draft disappears from the LHN when clicking away after starting a thread[/-] [+][HOLD for payment 2024-08-09] [$250] Draft disappears from the LHN when clicking away after starting a thread[/+] on Aug 2, 2024
  14. melvin-bot commented on Aug 2, 2024

    @melvin-bot

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

  15. removed
    Reviewing
    on Aug 2, 2024
  16. melvin-bot commented on Aug 2, 2024

    @melvin-bot

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

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

  17. melvin-bot commented on Aug 2, 2024

    @melvin-bot

    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:

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

    @abekkala
    Contributor

    PAYMENT SUMMARY FOR AUG 09

  19. added
    Daily
    and removed
    Weekly
    on Aug 8, 2024
  20. abekkala commented on Aug 8, 2024

    @abekkala
    Contributor

    not overdue payment is tomorrow

  21. mkhutornyi commented on Aug 8, 2024

    @mkhutornyi
    • The PR that introduced the bug has been identified. Link to the PR: Hide muted chats from LHN #22717
    • 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: https://github.com/Expensify/App/pull/22717/files#r1710079643
    • 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: N/A

    Regression Test Steps

    1. As user A, create a new group with user B and user C
    2. As user A, send a message to group
    3. As user B, start a thread and type something in composer
    4. Without joining, switch to another report
    5. Verify that thread report with draft keeps visible in LHN
  22. abekkala commented on Aug 9, 2024

    @abekkala
    Contributor

    @nkdengineer and @mkhutornyi - payments have been sent and contracts ended - thank you! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions