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.36k stars 2.78k forks source link

[$1000] Split Bill - Last Split Bill description within the group is displayed on all split bill detail pages #19855

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!


Issue found when executing PRhttps://github.com/Expensify/App/pull/19390

Action Performed:

  1. Go to NewDot
  2. Create a split bill with several users with description
  3. Open group chat and create another split bill with different description
  4. Open new split Details page for the first Split Bill

Expected Result:

Description from step 2 should be displayed

Actual Result:

Description from step 3 is displayed

Workaround:

Unknown

Platforms:

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

Version Number: 1.3.20.1

Reproducible in staging?: Yes

Reproducible in production?: No

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://platform.applause.com/services/links/v1/external/308be96fbcf3f79db684db2be6e296224360728aeae1cc63681b405b0cea2035

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/~01edb91d2bc99f8597
  • Upwork Job ID: 1663688334189305856
  • Last Price Increase: 2023-05-30
melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @twisterdotcom (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)

twisterdotcom commented 1 year ago

Very weird. It seems to be just taking the oldest open description:

image

Like in this instance, it's a split with two others, but the description is the description of a split with just the two from earlier:

image
melvin-bot[bot] commented 1 year ago

Job added to Upwork: https://www.upwork.com/jobs/~01edb91d2bc99f8597

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @techievivek (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

BhuvaneshPatil commented 1 year ago

Proposal

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

in Split bill detail page, the description shown is not matching with original

What is the root cause of that problem?

For MoneyRequestConfirmationList we are taking IOU from Onyx, that is global IOU. https://github.com/Expensify/App/blob/0d1995a209218f721eb8ba123091b17d3fb29964/src/components/MoneyRequestConfirmationList.js#L361-L372 example - When I try to create new Split Bill, the IOU will be using its description for the value. It's being set at below - https://github.com/Expensify/App/blob/0d1995a209218f721eb8ba123091b17d3fb29964/src/pages/iou/MoneyRequestDescriptionPage.js#L53-L56

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

Like we are passing the iouAmount to MoneyRquestConfirmationList component, we can pass the new prop iouComment from SplitBillDetailsPage.

Working Solution https://github.com/Expensify/App/assets/27822551/9fefe5ca-3f56-4f3a-92cb-2bba75ba9ba2

What alternative solutions did you explore? (Optional)

tienifr commented 1 year ago

Proposal

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

Split bill detail page doesn't show the correct comment

What is the root cause of that problem?

When users update the description, it will be stored in IOU (Onyx). https://github.com/Expensify/App/blob/2157057bdc23aaf1eb48846c9a87cd33ff6645ae/src/pages/iou/MoneyRequestDescriptionPage.js#L54

We just reset this value when open spillBill modal again

In

https://github.com/Expensify/App/blob/2157057bdc23aaf1eb48846c9a87cd33ff6645ae/src/components/MoneyRequestConfirmationList.js#L348

We're getting comment from IOU in Onyx, so that's wrong value

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

  1. In MoneyRequestModal: When users complete the transaction, we should clear this value in onyx by calling IOU.setMoneyRequestDescription(''); in onConfirm and onSendMoney.

https://github.com/Expensify/App/blob/2157057bdc23aaf1eb48846c9a87cd33ff6645ae/src/pages/iou/MoneyRequestModal.js#L361-L368

Or we can reset comment when the component is unmounted

Then pass iouComment={props.iou.comment} below this line

https://github.com/Expensify/App/blob/2157057bdc23aaf1eb48846c9a87cd33ff6645ae/src/pages/iou/MoneyRequestModal.js#L381

  1. In SpitBillDetailPage: get iou comment from reportAction like what we did with iou amount, and pass it to MoneyRequestConfirmationList
    const iouComment = lodashGet(reportAction, 'originalMessage.comment')
  1. In MoneyRequestConfirmationList: add iouComment as the new props and use it instead of this.props.iou.comment
Julesssss commented 1 year ago

Closing as a dupe of this previously reported issue. Feel free to add proposals to that issue instead.

twisterdotcom commented 1 year ago

Nice! I think that was created after, but I'm happy to have one off the plate. 😄

Julesssss commented 1 year ago

Created after, but it was raised way earlier in Slack. Better to keep the original issue rather than remember to pay out the contributor -- else I would have happily left this to you :)

esh-g commented 1 year ago

@tienifr Please review this comment: https://github.com/Expensify/App/issues/19870#issuecomment-1572682875 which is regarding a regression that can be caused if we use props.iouComment instead of props.iou.comment