-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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-10-25] [$250] [P2P Distance] Split - Participants amount displayed 0.00 briefly on confirmation screen #47100
Comments
👋 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:
|
Triggered auto assignment to @jasperhuangg ( |
We think that this bug might be related to #vip-split |
Not a blocker, it's behind the distance split beta. |
Job added to Upwork: https://www.upwork.com/jobs/~0170f1a1791408f62b |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat ( |
Triggered auto assignment to @garrettmknight ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Split distance - Participants amount displayed 0.00 briefly on confirmation screen What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
if (isDistanceRequest) {
let reportUpdated = report;
if (isPolicyExpenseChat && transaction?.participants?.[0]) {
reportUpdated = ReportUtils.getReport(transaction?.participants?.[0].reportID ?? '') ?? report;
}
const policyID = IOU.getIOURequestPolicyID(transaction, reportUpdated);
const policy = PolicyUtils.getPolicy(report?.policyID ?? policyID);
const policyCurrency = policy?.outputCurrency ?? PolicyUtils.getPersonalPolicy()?.outputCurrency ?? CONST.CURRENCY.USD;
const customUnitRateID = TransactionUtils.getRateID(transaction) ?? '-1';
const mileageRates = DistanceRequestUtils.getMileageRates(policy);
const defaultMileageRate = DistanceRequestUtils.getDefaultMileageRate(policy);
const mileageRate = TransactionUtils.isCustomUnitRateIDForP2P(transaction)
? DistanceRequestUtils.getRateForP2P(policyCurrency)
: mileageRates?.[customUnitRateID] ?? defaultMileageRate;
const {unit, rate} = mileageRate ?? {};
const distance = TransactionUtils.getDistanceInMeters(transaction, unit);
const currency = (mileageRate as MileageRate)?.currency ?? policyCurrency;
const amount = DistanceRequestUtils.getDistanceRequestAmount(distance, unit ?? CONST.CUSTOM_UNITS.DISTANCE_UNIT_MILES, rate ?? 0);
IOU.setMoneyRequestAmount(transactionID, amount, currency ?? '');
const participantsMap =
transaction?.participants?.map((participant) => {
if (participant.isSender && iouType === CONST.IOU.TYPE.INVOICE) {
return participant;
}
return participant.accountID ? OptionsListUtils.getParticipantsOption(participant, personalDetails) : OptionsListUtils.getReportOption(participant);
}) ?? [];
const participantAccountIDs: number[] = participantsMap.map((participant) => participant.accountID ?? -1);
if (isTypeSplit && !isPolicyExpenseChat && amount && transaction?.currency) {
IOU.setSplitShares(transaction, amount, currency, participantAccountIDs);
}
} Note The code above is not perfect, it is just pseudocode and can be improved. It might also have some flaws, but these can be addressed after thorough testing. What alternative solutions did you explore? (Optional) |
Edited by proposal-police: This proposal was edited at 2024-08-09 01:17:59 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
the correct amount is displayed afterward. What changes do you think we should make in order to solve the problem?
will be: rightElement: transaction?.splitShares?.[participantOption.accountID ?? -1]?.amount !== undefined ? (
<MoneyRequestAmountInput />
) : (
<ActivityIndicator color={!true ? theme.textLight : theme.text} />
) |
@parasharrajat can you give these proposals a look when you get a chance? |
@garrettmknight, @parasharrajat, @jasperhuangg Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@garrettmknight, @parasharrajat, @jasperhuangg, @Krishna2323 12 days overdue now... This issue's end is nigh! |
PR is close to merge. |
I am no longer able to reproduce this issue on the App. But @Krishna2323 showed that the code still gets the proper values on the second render #47370 (comment). This is not visible on the UI. Should we pursue the solution further to get the values in the first render? @jasperhuangg |
@parasharrajat, have you tried this on a physical Android device? I don't have beta access to create P2P distance requests. |
Ok. I didn't notice that. Looks like this is an issue on low-end devices. Let me get back on the PR review. |
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. |
In the process of fixing that blocker the PR was reverted #47370. I asked on the blocker issue here if we can re-apply this PR because it sounds like maybe it didn't need to be reverted in the first place. Either way we need to redo this and make sure it's not causing any bugs. @Krishna2323 when will you be able to put up another PR? |
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.50-8 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-10-25. 🎊 For reference, here are some details about the assignees on this issue:
|
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:
|
I will raise the PR on Monday once we get confirmation on this. |
is there something pending on this issue? @Krishna2323 It looks like the PR was reapplied #51156 |
@parasharrajat, there’s nothing pending here. @garrettmknight, this will be ready for payments in 2 days, as the reapplied PR was deployed to production 5 days ago :) |
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:
Regression Test Steps
Do you agree 👍 or 👎 ? |
Payment Summary:
|
@garrettmknight @jasperhuangg Be sure to fill out the Contact List! |
Payment requested as per #47100 (comment) |
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.18.3
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): applausetester+0808pm@applause.expensifail.com
Issue reported by: Applause - Internal Team
Issue found when executing PR #42302
Action Performed:
Expected Result:
The correct participants amounts are displayed
Actual Result:
0.00 is briefly displayed instead of the correct amount
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6565894_1723139401565.video_2024-08-08_13-48-49.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @garrettmknightThe text was updated successfully, but these errors were encountered: