Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.56k stars 2.9k forks source link

[$500] Chat - Split bill preview displays skeleton view after login again #28713

Closed kbecciv closed 1 year ago

kbecciv commented 1 year ago

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 announce chat room
  2. Create a split bill
  3. Sign out and sign in again
  4. Open the announce chat room again

Expected Result:

The split bill should be displayed

Actual Result:

The split bill preview displays a skeleton view

Workaround:

Unknown

Platforms:

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

Version Number: 1.3.76.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 Notes/Photos/Videos: Any additional supporting documentation

https://github.com/Expensify/App/assets/93399543/53c8ee0b-df7f-4c04-9d2a-a69350abb348

https://github.com/Expensify/App/assets/93399543/6b01c82a-82d8-4870-aa91-e5117b7527c2

https://github.com/Expensify/App/assets/93399543/2db65a89-8767-4ffe-b8f8-02d51980fcba

untitled.webm

https://github.com/Expensify/App/assets/93399543/9a06bfef-8c05-4846-a0dc-b878898036b0

Screencast from 02-10-2023 15_06_13.webm

Expensify/Expensify Issue URL: Issue reported by: @dukenv0307 Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696234232663269

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01752787251543788d
  • Upwork Job ID: 1709177646929657856
  • Last Price Increase: 2023-10-10
melvin-bot[bot] commented 1 year ago

Job added to Upwork: https://www.upwork.com/jobs/~01752787251543788d

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

melvin-bot[bot] commented 1 year ago

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

kbecciv commented 1 year ago

Proposal by: @dukenv0307 Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696234232663269

Proposal

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

Split bill preview displays skeleton view after login again

What is the root cause of that problem?

In MoneyRequestPreview We have the condition here to display skeleton. When we open the announce report, the openReport API doesn't return the transaction data of the split bill and then the skeleton is displayed https://github.com/Expensify/App/blob/c390d5e08d38f8c4dd7f0e134b42042f5a08a7ee/src/components/ReportActionItem/MoneyRequestPreview.js#L248-L252

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

In MoneyRequestPreview, if the transaction is split bill we can get the data from props.action if the transaction is empty. We can do the same thing in SplitBillDetailPage

if (props.isBillSplit && _.isEmpty(props.transaction)) {
    requestAmount = parseInt(lodashGet(props.action, 'originalMessage.amount', 0), 10);
    requestCurrency = lodashGet(props.action, 'originalMessage.comment');
    requestComment = lodashGet(props.action, 'originalMessage.currency');
}

and we can change the conditions here by adding the check whether the preview is split bill or not

{_.isEmpty(props.transaction) &&
!props.isBillSplit &&
!ReportActionsUtils.isMessageDeleted(props.action) &&
lodashGet(props.action, 'pendingAction') !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ? (

https://github.com/Expensify/App/blob/c390d5e08d38f8c4dd7f0e134b42042f5a08a7ee/src/components/ReportActionItem/MoneyRequestPreview.js#L248-L252

What alternative solutions did you explore? (Optional)

BE should return transaction data of the split bill in openReport API if this report has split bill action

maddylewis commented 1 year ago

@jjcoffee - bump on proposal review - ty!

aimane-chnaif commented 1 year ago

Dupe of #26020

melvin-bot[bot] commented 1 year ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] commented 1 year ago

@jjcoffee, @maddylewis Whoops! This issue is 2 days overdue. Let's get this updated quick!

jjcoffee commented 1 year ago

@maddylewis This is a dupe, I think we're good to close!