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-06-19] [$1000] Split Bill preview not showing correct description/currency #19870

Closed
6 tasks done
kavimuru opened this issue May 31, 2023 · 33 comments
Closed
6 tasks done
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

@kavimuru
Copy link

kavimuru commented May 31, 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!


Action Performed:

  1. Create a Split Bill request using currency A and no description
  2. Start a new money request flow (send/request/split)
  3. Choose currency B and set description to any text
  4. Don't complete it and close the page
  5. Press the Split Bill preview to see the detail

Expected Result:

The currency and description should show the currency and description used when creating the request

Actual Result:

The currency and description dynamically changes every time we set a new value from money request flow

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

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

Version Number: 1.3.20-3
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

Screen.Recording.2023-05-29.at.22.03.49.mov
Recording.818.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012fa29a23a09e4f51
  • Upwork Job ID: 1663824064534704128
  • Last Price Increase: 2023-05-31
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 31, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 31, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 31, 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

@therealsujitk
Copy link
Contributor

therealsujitk commented May 31, 2023

Proposal

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

The description in the split bill details page gets reset to the latest value saved in Onyx. Note that the same issue also occurs for the currency code.

What is the root cause of that problem?

The reason for this is because we are not getting these details from the report but rather from Onyx as shown in the code below.

const formattedAmount = CurrencyUtils.convertToDisplayString(this.props.iouAmount, this.props.iou.selectedCurrencyCode);

title={this.props.iou.comment}

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

To fix this these values have to passed down as props (undefined by default) from the SplitBillDetailsPage. If they are undefined, values from Onyx will be used.

...
const splitAmount = parseInt(lodashGet(reportAction, 'originalMessage.amount', 0), 10);
const splitCurrencyCode = lodashGet(reportAction, 'originalMessage.currency');
const splitComment = lodashGet(reportAction, 'originalMessage.comment');

<MoneyRequestConfirmationList
    ...
    iouAmount={splitAmount}
    iouCurrencyCode={splitCurrencyCode}
    iouComment={splitComment}
    iouType={CONST.IOU.MONEY_REQUEST_TYPE.SPLIT}
    isReadOnly
    shouldShowFooter={false}
/>

What alternative solutions did you explore? (Optional)

None.

@Julesssss Julesssss added the External Added to denote the issue can be worked on by a contributor label May 31, 2023
@melvin-bot melvin-bot bot changed the title Currency and description in Split Bill detail dynamicall changes [$1000] Currency and description in Split Bill detail dynamicall changes May 31, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 31, 2023

Job added to Upwork: https://www.upwork.com/jobs/~012fa29a23a09e4f51

@melvin-bot
Copy link

melvin-bot bot commented May 31, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 31, 2023

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

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

melvin-bot bot commented May 31, 2023

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

@Julesssss Julesssss changed the title [$1000] Currency and description in Split Bill detail dynamicall changes [$1000] Split Bill preview not showing correct description/currency May 31, 2023
@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented May 31, 2023

original proposal here - #19855 (comment)

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.

export default compose(
withLocalize,
withWindowDimensions,
withCurrentUserPersonalDetails,
withOnyx({
iou: {key: ONYXKEYS.IOU},
session: {
key: ONYXKEYS.SESSION,
},
}),
)(MoneyRequestConfirmationList);
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 -
updateComment(value) {
IOU.setMoneyRequestDescription(value.moneyRequestComment);
Navigation.goBack();
}

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, this will cause a regression as mentioned in #19870 (comment), to avoid that, we can conditionally select the comment from props and onyx.

title={this.props.iouComment || this.props.iou.comment}

Similarly we can add another prop for currency as well.
The values for them can be grabbed from reportAction in SplitBillDetailsPage component.

Working Solution
Split.Bill.Description.Issue.-.Made.with.Clipchamp.mp4

What alternative solutions did you explore? (Optional)

  • Updating IOU in ONYX using setMoneyRequestDescription() can be a alternative, however this change should be made carefully, because that value(IOU) is being used at many places. When we open the modal we can use setMoneyRequestDescription() to set the value of description and upon closing we can reset it to empty string.

  • We can pass the reportAction as a prop as well, if there are multiple things we need to add from reportAction to MoneyRequestConfirmationLinks

@esh-g
Copy link
Contributor

esh-g commented Jun 1, 2023

Proposal

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

'Description' field displays blank content for split bill participants

What is the root cause of that problem?

The root cause is that we are using MoneyRequestConformationList component while creating the split bill as well as displaying details of the IOU reportAction. While creating bill, the this.props.iou.comment is defined and is passed to the description text but while viewing details, this.props.iou.comment is undefined because the viewing details come from the reportAction and not from ONYXKEYS.IOU which was the case while creating the bill.

<MenuItemWithTopDescription
shouldShowRightIcon={!this.props.isReadOnly}
title={this.props.iou.comment}
description={this.props.translate('common.description')}
onPress={() => Navigation.navigate(ROUTES.MONEY_REQUEST_DESCRIPTION)}
style={[styles.moneyRequestMenuItem, styles.mb2]}
disabled={this.state.didConfirm || this.props.isReadOnly}
/>

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

<MoneyRequestConfirmationList
hasMultipleParticipants
payeePersonalDetails={payeePersonalDetails}
participants={participantsExcludingPayee}
iouAmount={splitAmount}
iouType={CONST.IOU.MONEY_REQUEST_TYPE.SPLIT}
isReadOnly
shouldShowFooter={false}
/>

While rendering the MoneyRequestConformationList in SplitBillDetailsPage, we are passing the amount as a prop but not the comment. So, we need to pass a prop called iouComment which should be equal to lodashGet(reportAction, 'originalMessage.comment', '') Just like we do for amount on line 71.
Then in MoneyRequestConformationList we need to check if this.props.iouComment exists, then display that, otherwise display this.props.iou.comment like this: (in line 348, MoneyRequestConformationList.js)

title={this.props.iouComment || this.props.iou.comment}

After Applying:

Screen.Recording.2023-06-01.at.11.39.05.PM-1.mov

@esh-g
Copy link
Contributor

esh-g commented Jun 1, 2023

Proposals of @therealsujitk and @BhuvaneshPatil will cause a regression because we are using MoneyRequestConformationList while displaying details as well as while creating a bill, and for that we cannot completely replace this.props.iou.comment like suggested in their proposals.

Screen.Recording.2023-06-02.at.1.18.39.AM.mov

@melvin-bot melvin-bot bot added the Overdue label Jun 2, 2023
@Julesssss
Copy link
Contributor

Bumping for review @eVoloshchak

@melvin-bot melvin-bot bot removed the Overdue label Jun 2, 2023
@eVoloshchak
Copy link
Contributor

All of the proposals are quite similar, I think we should proceed with the first proposal that correctly identified the root cause.
Since #19870 is a dupe of this issue, I did review proposals in both.
@BhuvaneshPatil's proposal was posted first (here), It looks good to me

🎀👀🎀 C+ reviewed!
cc: @Julesssss

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 2023

📣 @BhuvaneshPatil You have been assigned to this job by @Julesssss!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@BhuvaneshPatil
Copy link
Contributor

Hello, I have applied. PR will be ready by EOD. Thank you

@BhuvaneshPatil
Copy link
Contributor

Hello, the PR is merged. What is next process?

@Julesssss
Copy link
Contributor

We're still waiting for it to be deployed to production. We often don't deploy on Fridays, but you should see an automated comment on this issue either today or Monday.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jun 12, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Split Bill preview not showing correct description/currency [HOLD for payment 2023-06-19] [$1000] Split Bill preview not showing correct description/currency Jun 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 12, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 12, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.26-4 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-06-19. 🎊

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

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 Jun 12, 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:

  • [@eVoloshchak] The PR that introduced the bug has been identified. Link to the PR:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] Determine if we should create a regression test for this bug.
  • [@eVoloshchak] 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.
  • [@flaviadefaria] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/294930

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 19, 2023
@BhuvaneshPatil
Copy link
Contributor

@eVoloshchak @Julesssss @flaviadefaria
friendly bump for further process.

@Julesssss
Copy link
Contributor

This one is ready to pay once the checklists above are filled by @flaviadefaria and @eVoloshchak 👍

@flaviadefaria
Copy link
Contributor

Waiting for @eVoloshchak to complete the checklist so that I can issue the following payments:
@bernhardoj $250
@BhuvaneshPatil $1000 (no bonus)
@eVoloshchak $1000 (no bonus)

@BhuvaneshPatil
Copy link
Contributor

Hello @flaviadefaria , can you please share the timing of assignment and when the PR got merged, because there was a weekend in between.

@Julesssss
Copy link
Contributor

I think our CI script failed to generate it for this PR. Removing the Saturday and Sunday I think is eligible:

Assigned
Screenshot 2023-06-21 at 14 01 49

Merged
Screenshot 2023-06-21 at 14 02 06

@flaviadefaria
Copy link
Contributor

flaviadefaria commented Jun 21, 2023

Cool, thanks for checking. So updated payments will be:
@bernhardoj $250
@BhuvaneshPatil $1000 + $500 bonus
@eVoloshchak $1000 + $500 bonus

I'll issue them as soon as @eVoloshchak completes the checklist above.

@eVoloshchak
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: N/A, that's how it was implemented initially in Create currency modal with react-native-permissions and geolocation #2194

  • 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: N/A

  • 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: Don't think there's anything we could add to our processes/docs, this was simply missed during the initial implementation

  • Determine if we should create a regression test for this bug.
    Is it easy to test for this bug? Yes
    Is the bug related to an important user flow? Yes
    Is it an impactful bug? Yes

@eVoloshchak
Copy link
Contributor

Regression Test Proposal

  1. Press FAB -> Create a Split Bill request using currency A and no description
  2. Start a new money request flow (send/request/split)
  3. Choose another currency and enter a description
  4. Don't complete it and close the page
  5. Press the Split Bill preview to see the details of the first split bill
  6. Verify currency and description arr correct for the first split bill

Do we agree 👍 or 👎

@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented Jun 22, 2023

@eVoloshchak
I have tested it, shows the correct currency and description. Sharing video soon

sample.regression.test.-.Made.with.Clipchamp.1.mp4

@melvin-bot melvin-bot bot added the Overdue label Jun 26, 2023
@Julesssss
Copy link
Contributor

Hey @flaviadefaria, based on your last question, I think we are good to pay out now?

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2023
@flaviadefaria
Copy link
Contributor

Yep, now we are. I'll handle the payment today.

@Julesssss
Copy link
Contributor

Thanks

@flaviadefaria
Copy link
Contributor

Offer sent!

@flaviadefaria
Copy link
Contributor

All done so closing this GH.

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