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-21] [$1000] Scan IOU - 1:1 DM disappears after opening IOU report page when Scan IOU is created offline #25770

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

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 23, 2023

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
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

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

@melvin-bot
Copy link

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

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.

@melvin-bot melvin-bot bot added the Overdue label Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

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

@mallenexpensify mallenexpensify added the External Added to denote the issue can be worked on by a contributor label Aug 30, 2023
@melvin-bot melvin-bot bot 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 Aug 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

Job added to Upwork: https://www.upwork.com/jobs/~016eaa15aa0f40ecf9

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

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

@mallenexpensify
Copy link
Contributor

Was able to reproduce, no idea why it's happening.
https://github.com/Expensify/App/assets/22508304/525e2938-6d9c-4319-88b4-6d5fee6851cb

@rushatgabhane, if you agree this can be External, can you review @StevenKKC 's proposal above? Thx

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Aug 30, 2023
@mallenexpensify mallenexpensify removed their assignment Sep 4, 2023
@melvin-bot melvin-bot bot removed the Overdue label Sep 4, 2023
@mallenexpensify mallenexpensify added Overdue Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

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

@melvin-bot

This comment was marked as off-topic.

@mallenexpensify
Copy link
Contributor

@rushatgabhane please review @StevenKKC 's proposal above

@sophiepintoraetz I'm off this week, can you please keep 👀 on this then I'll snag it back on Monday? Thx

@mallenexpensify mallenexpensify self-assigned this Sep 4, 2023
@rushatgabhane
Copy link
Member

I like @StevenKKC's proposal #25770 (comment)

🎀 👀 🎀

@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

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

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:

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 14, 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:

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

@mallenexpensify
Copy link
Contributor

Issue reporter: Applause
Contributor: @StevenKKC paid $1500 via Upwork, inc. 50% urgency bonus
Contributor+: @rushatgabhane is due $1500 via NewDot

@rushatgabhane can you please fill out the BZ checklist above?

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

Created a manual request - https://staging.new.expensify.com/r/3391576689486096

@melvin-bot melvin-bot bot added the Overdue label Sep 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 29, 2023

@amyevans, @mallenexpensify, @rushatgabhane, @StevenKKC Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@mallenexpensify
Copy link
Contributor

@rushatgabhane please fill out the BZ checklist so I can close this

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

melvin-bot bot commented Oct 3, 2023

@amyevans, @mallenexpensify, @rushatgabhane, @StevenKKC Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@amyevans
Copy link
Contributor

amyevans commented Oct 3, 2023

Bump @rushatgabhane

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 3, 2023
@JmillsExpensify
Copy link

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

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

@amyevans
Copy link
Contributor

amyevans commented Oct 9, 2023

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

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 13, 2023

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

@mallenexpensify
Copy link
Contributor

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

@melvin-bot melvin-bot bot removed the Overdue label Oct 13, 2023
@rushatgabhane
Copy link
Member

rushatgabhane commented Oct 16, 2023

  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

@rushatgabhane
Copy link
Member

rushatgabhane commented Oct 16, 2023

@mallenexpensify updated! we need to add a regression test

@mallenexpensify
Copy link
Contributor

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 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants