Skip to content

[HOLD for payment 2023-09-21] [$1000] Scan IOU - 1:1 DM disappears after opening IOU report page when Scan IOU is created offline #25770

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!


Issue found when executing PR #25613

Action Performed:

  1. Go to staging.new.expensify,com
  2. Go offline
  3. Create a Manual IOU with a user with no conversation history
  4. Open 1:1 DM and IOU report page. Verify that both reports are not missing in LHN
  5. Create a Scan IOU with another user with no conversation history
  6. Open 1:1 DM and IOU report page

Expected Result:

1:1 DM created in Step 5 will not disappear from LHN after opening IOU report page

Actual Result:

1:1 DM created in Step 5 disappears from LHN after opening IOU report page

Workaround:

Unknown

Platforms:

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

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

Version Number: 1.3.56-18

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

Bug6174598_20230823_203944.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/~016eaa15aa0f40ecf9
  • Upwork Job ID: 1696697017540784128
  • Last Price Increase: 2023-08-30
  • Automatic offers:
    • StevenKKC | Contributor | 26617203

Activity

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

    @melvin-bot

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

  3. melvin-bot commented on Aug 23, 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. StevenKKC commented on Aug 23, 2023

    @StevenKKC
    Contributor

    Proposal

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

    Scan IOU - 1:1 DM disappears after opening IOU report page when Scan IOU is created offline

    What is the root cause of that problem?

    If create a Scan IOU with a user with no conversation history, CREATED action and REPORTPREVIEW action for chat report are generated.

    const optimisticCreatedActionForChat = ReportUtils.buildOptimisticCreatedReportAction(payeeEmail);

    reportPreviewAction = ReportUtils.buildOptimisticReportPreview(chatReport, iouReport, comment, optimisticTransaction);

    When build a REPORTPREVIEW action, we are setting whisperedToAccountIDs if has receipt.
    whisperedToAccountIDs: hasReceipt ? [currentUserAccountID] : [],

    So REPORTPREVIEW action is treated as whisper action, and then lastVisibleAction for chat report is CREATED action.

    return shouldReportActionBeVisible(reportAction, reportAction.reportActionID) && !isWhisperAction(reportAction) && !isDeletedAction(reportAction);

    Therefore, lastMessageText for chat report is empty, and then chat report is treated as empty chat and disappears from LHN.

    if (isCreatedAction(lastVisibleAction)) {
    return {
    lastMessageText: '',
    };
    }

    App/src/libs/ReportUtils.js

    Lines 2612 to 2613 in 5d1d5f1

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

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

    We can add checking whether whisper action is REPORTPREVIEW action or not.
    Only if whisper action is not REPORTPREVIEW action, then return false in shouldReportActionBeVisibleAsLastAction.

        return shouldReportActionBeVisible(reportAction, reportAction.reportActionID) && !(isWhisperAction(reportAction) && !isReportPreviewAction(reportAction)) && !isDeletedAction(reportAction);

    What alternative solutions did you explore? (Optional)

    We can remove this line to not set whisperedToAccountIDs when build REPORTPREVIEW action.

  5. melvin-bot commented on Aug 29, 2023

    @melvin-bot

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

  6. added
    External
    on Aug 30, 2023
  7. changed the title [-] Scan IOU - 1:1 DM disappears after opening IOU report page when Scan IOU is created offline[/-] [+][$1000] Scan IOU - 1:1 DM disappears after opening IOU report page when Scan IOU is created offline[/+] on Aug 30, 2023
  8. melvin-bot commented on Aug 30, 2023

    @melvin-bot
  9. added
    Help Wanted
    on Aug 30, 2023
  10. melvin-bot commented on Aug 30, 2023

    @melvin-bot

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

  11. melvin-bot commented on Aug 30, 2023

    @melvin-bot

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

  12. 50 remaining items

  13. amyevans commented on Oct 3, 2023

    @amyevans
    Contributor
  14. JmillsExpensify commented on Oct 7, 2023

    @JmillsExpensify
    Contributor

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

  15. melvin-bot commented on Oct 9, 2023

    @melvin-bot

    @amyevans, @mallenexpensify, @rushatgabhane, @StevenKKC Eep! 4 days overdue now. Issues have feelings too...

  16. amyevans commented on Oct 9, 2023

    @amyevans
    Contributor

    @rushatgabhane friendly bump on the checklist, I think that's all that remains before we can close 🙏

  17. melvin-bot commented on Oct 13, 2023

    @melvin-bot

    @amyevans, @mallenexpensify, @rushatgabhane, @StevenKKC Whoops! This issue is 2 days overdue. Let's get this updated quick!

  18. mallenexpensify commented on Oct 13, 2023

    @mallenexpensify
    Contributor

    @rushatgabhane please finish the BZ checklist then we can close, I'll ping ya in NewDot too
    #25770 (comment)

  19. rushatgabhane commented on Oct 16, 2023

    @rushatgabhane
    Member
    1. The PR that introduced the bug has been identified. Link to the PR: Optimistic report previews #21578

    2. 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/21578/files#r1360155419

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

    4. Determine if we should create a regression test for this bug. Yes

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

      1. Open app
      2. Go to settings -> preferences -> Enable force offline
      3. Create a Scan IOU with another user with no conversation history.
      4. Open 1:1 DM and IOU report
      5. Verify that 1:1 DM report will not disappear from LHN after opening IOU report page
  20. rushatgabhane commented on Oct 16, 2023

    @rushatgabhane
    Member

    @mallenexpensify updated! we need to add a regression test

  21. mallenexpensify commented on Oct 16, 2023

    @mallenexpensify
    Contributor
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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions