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

[$250] Android - scan - In mweb, in "your split amount" place (0) is displayed but in Android it is not #46710

Closed
1 of 6 tasks
lanitochka17 opened this issue Aug 2, 2024 · 23 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 2, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.16
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4801165
Issue reported by: Applause - Internal Team

Action Performed:

  1. Launch Android app and mweb
  2. Create a scanned split expense with 4 participants with amount 0.08
  3. Open the report and note preview

Expected Result:

In mweb and Android, the behaviour of displaying split amount must be consistent

Actual Result:

In mweb, in "your split amount" place zero (0) is displayed but in Android it is not shown

Workaround:

Unknown

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

Bug6559577_1722542646012.Screenrecorder-2024-08-02-01-24-51-312_compress_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010e8f218196384ca1
  • Upwork Job ID: 1820842286524273233
  • Last Price Increase: 2024-08-06
  • Automatic offers:
    • rojiphil | Reviewer | 103496878
Issue OwnerCurrent Issue Owner: @rojiphil
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 2, 2024
Copy link

melvin-bot bot commented Aug 2, 2024

Triggered auto assignment to @muttmuure (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@lanitochka17
Copy link
Author

@muttmuure FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-split

@bernhardoj
Copy link
Contributor

Proposal

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

In split money request preview, 0 is shown.

What is the root cause of that problem?

The "your split amount" shows the split amount for each participant. If the current user split share is 0, then 0 is shown because 0 && </> will render 0 because 0 is falsey.

{splitShare && (
<Text style={[styles.textLabel, styles.colorMuted, styles.ml1, styles.amountSplitPadding]}>
{translate('iou.yourSplit', {amount: CurrencyUtils.convertToDisplayString(splitShare ?? 0, requestCurrency)})}
</Text>
)}

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

We should cast it to a boolean using !!.

{!!splitShares && </>}

Also, the splitShares type is currently a number or boolean,

const splitShare = useMemo(
() =>
shouldShowSplitShare &&
(transaction?.comment?.splits?.find((split) => split.accountID === sessionAccountID)?.amount ??
IOUUtils.calculateAmount(isPolicyExpenseChat ? 1 : participantAccountIDs.length - 1, requestAmount, requestCurrency ?? '', action.actorAccountID === sessionAccountID)),
[shouldShowSplitShare, isPolicyExpenseChat, action.actorAccountID, participantAccountIDs.length, transaction?.comment?.splits, requestAmount, requestCurrency, sessionAccountID],
);

we can fix this too by returning 0 if shouldShowSplitShare is false.

shouldShowSplitShare ? ... : 0

Copy link
Contributor

github-actions bot commented Aug 2, 2024

true

@melvin-bot melvin-bot bot added the Overdue label Aug 5, 2024
Copy link

melvin-bot bot commented Aug 5, 2024

@muttmuure Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@muttmuure muttmuure added the External Added to denote the issue can be worked on by a contributor label Aug 6, 2024
@melvin-bot melvin-bot bot changed the title Android - scan - In mweb, in "your split amount" place (0) is displayed but in Android it is not [$250] Android - scan - In mweb, in "your split amount" place (0) is displayed but in Android it is not Aug 6, 2024
Copy link

melvin-bot bot commented Aug 6, 2024

Job added to Upwork: https://www.upwork.com/jobs/~010e8f218196384ca1

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

melvin-bot bot commented Aug 6, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Aug 6, 2024
Copy link

melvin-bot bot commented Aug 9, 2024

@rojiphil, @muttmuure Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Aug 9, 2024
@rojiphil
Copy link
Contributor

Since a split value of 0 is a possible value for a participant, not showing anything makes sense. And displaying 0 does not make sense at all.
Casting splitShare to boolean makes sense to solve this issue.
@bernhardoj proposal LGTM.
🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Aug 10, 2024

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

@marcochavezf
Copy link
Contributor

Sounds good @rojiphil, assigning @bernhardoj 🚀

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 12, 2024
Copy link

melvin-bot bot commented Aug 12, 2024

📣 @rojiphil 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot melvin-bot bot added Reviewing Has a PR in review and removed Daily KSv2 labels Aug 13, 2024
@melvin-bot melvin-bot bot added the Weekly KSv2 label Aug 13, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @rojiphil

@bernhardoj
Copy link
Contributor

The PR was deployed 2 weeks ago, so this should be ready for payment.

Requested in ND.

@JmillsExpensify
Copy link

Waiting on the payment summary

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Sep 5, 2024
Copy link

melvin-bot bot commented Sep 5, 2024

This issue has not been updated in over 15 days. @rojiphil, @marcochavezf, @muttmuure, @bernhardoj eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@rojiphil
Copy link
Contributor

rojiphil commented Sep 5, 2024

Oh! The automation failed here.
@muttmuure Can you please help with payment here as this has been in production since the last 3 weeks?

@marcochavezf marcochavezf added Weekly KSv2 Daily KSv2 and removed Monthly KSv2 Weekly KSv2 labels Sep 5, 2024
@muttmuure
Copy link
Contributor

$250 - @rojiphil
$250 - @bernhardoj

@bernhardoj
Copy link
Contributor

Requested in ND.

@rojiphil
Copy link
Contributor

rojiphil commented Sep 6, 2024

@muttmuure Accepted offer on Upwork. Awaiting payment. Thanks.

@muttmuure
Copy link
Contributor

Paid

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

6 participants