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 2024-04-15] IOU - Skeleton IOU preview appears in IOU details page when there is one request #39403

Closed
6 tasks done
kbecciv opened this issue Apr 2, 2024 · 11 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production DeployBlockerCash This issue or pull request should block deployment Engineering Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Apr 2, 2024

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


Version Number: 1.4.59-0
Reproducible in staging?: y
Reproducible in production?: n
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Request money.
  3. Create a manual request from any user.
  4. In 1:1 DM, click on the IOU preview.

Expected Result:

There will no be preview in transaction thread.

Actual Result:

A skeleton preview is shown in transaction thread.

Workaround:

n/a

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

Add any screenshot/video evidence

Bug6435479_1712058056237.IOU.mp4

View all open jobs on GitHub

@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

Triggered auto assignment to @puneetlath (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@kbecciv
Copy link
Author

kbecciv commented Apr 2, 2024

We think that this bug might be related to #wave-collect - Release 1

Copy link
Contributor

github-actions bot commented Apr 2, 2024

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@paultsimura
Copy link
Contributor

Proposal

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

The empty skeleton report action is added for a one-transaction IOU Report view.

What is the root cause of that problem?

This was caused by #36934 which introduced the one-transaction view.
The reason is that we filter out the IOU Report Action from the list if it's a single-transaction report.

But later here, we build an optimistic report preview action (the skeleton one) if the amount of filtered transactions is less than reportPreviewAction?.childMoneyRequestCount:

if (report.total && moneyRequestActions.length < (reportPreviewAction?.childMoneyRequestCount ?? 0)) {
const optimisticIOUAction = ReportUtils.buildOptimisticIOUReportAction(
CONST.IOU.REPORT_ACTION_TYPE.CREATE,
0,
CONST.CURRENCY.USD,
'',
[],
NumberUtils.rand64(),
undefined,
report.reportID,
false,
false,
{},
false,
DateUtils.subtractMillisecondsFromDateTime(actions[actions.length - 1].created, 1),
) as OnyxTypes.ReportAction;
moneyRequestActions.push(optimisticIOUAction);
actions.splice(actions.length - 1, 0, optimisticIOUAction);
}

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

We need to count for the special one-transaction case now, and change the condition to:

if (report.total && !isOneTransactionView && moneyRequestActions.length < (reportPreviewAction?.childMoneyRequestCount ?? 0)) {
...

Where the isOneTransactionView might be reportPreviewAction?.childMoneyRequestCount === 1 (need to verify this deeper into the original PR).

What alternative solutions did you explore? (Optional)

@NikkiWines
Copy link
Contributor

Oh, yep - definitely introduced by #36934. We should be using combinedReportActions there and also if we've passed a transactionThreadReport we know that the report is a one-transaction report and should skip the optimistic preview.

@NikkiWines
Copy link
Contributor

@puneetlath I'll spin up a PR to handle the couple blockers that #36934 introduced, so i can take this over if you'd like

Copy link

melvin-bot bot commented Apr 2, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@NikkiWines NikkiWines added the Reviewing Has a PR in review label Apr 2, 2024
@melvin-bot melvin-bot bot removed the Hourly KSv2 label Apr 2, 2024
@NikkiWines NikkiWines self-assigned this Apr 2, 2024
@melvin-bot melvin-bot bot added the Weekly KSv2 label Apr 2, 2024
@NikkiWines NikkiWines removed the Reviewing Has a PR in review label Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@NikkiWines NikkiWines added the Reviewing Has a PR in review label Apr 2, 2024
@NikkiWines
Copy link
Contributor

No skeleton on staging 🎊

Screen.Recording.2024-04-02.at.15.13.01.mov

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 8, 2024
@melvin-bot melvin-bot bot changed the title IOU - Skeleton IOU preview appears in IOU details page when there is one request [HOLD for payment 2024-04-15] IOU - Skeleton IOU preview appears in IOU details page when there is one request Apr 8, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 8, 2024
Copy link

melvin-bot bot commented Apr 8, 2024

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

Copy link

melvin-bot bot commented Apr 8, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.60-13 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-04-15. 🎊

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 DeployBlockerCash This issue or pull request should block deployment Engineering Weekly KSv2
Projects
None yet
Development

No branches or pull requests

4 participants