You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-11-14] [$250] QAB - Error shows up when submitting split distance expense via split manual shortcut in QAB #50694
Version Number: 9.0.48-0 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers):applausetester+kh081006@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Go to staging.new.expensify.com
Go to group chat (more than 2).
Click + > Split expense > Manual.
Split a manual expense in the group chat.
Click FAB.
Click Split manual under Quick action.
Click Distance.
Submit a split distance expense.
Expected Result:
No error will show up when submitting split distance expense via split manual shortcut in QAB.
Actual Result:
Error shows up when submitting split distance expense via split manual shortcut in QAB.
@slafortune 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
Edited by proposal-police: This proposal was edited at 2024-10-21 17:06:08 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
For distance request via split expense for quick actions, we directly create split request instead of distance request and the BE throws error
What is the root cause of that problem?
When we create a manual split request, and then from quick actions create a distance request due to shouldSkipConfirmation being true, we create a split request for distance instead of a distance request:
This is because shouldSkipConfirmation is true For quick button actions, we'll skip the confirmation page unless the report is archived or this is a workspace:
// For quick button actions, we'll skip the confirmation page unless the report is archived or this is a workspace
// request and the workspace requires a category or a tag
So we never considered the case for group chats, and hence we skip the confirmation step and call the wrong api and get error.
What changes do you think we should make in order to solve the problem?
Current shouldSkipConfirmation doesn't consider the case for group chats, so we should add a check that we should not skip the confirmation step when we are on group chat:
Like we do on QAB split manual request page, there too shouldSkipConfirmation is true still we do not skip confirmation page because we have the following check that only calls IOU.splitBill when it is a scan request and defaults to confirmation page for manual request:
if(shouldSkipConfirmation){// Only skip confirmation when the split is not configurable, for now Smartscanned splits cannot be configuredif(iouType===CONST.IOU.TYPE.SPLIT&&transaction?.iouRequestType===CONST.IOU.REQUEST_TYPE.SCAN){IOU.splitBill({
OR
if(shouldSkipConfirmation&&transaction?.iouRequestType===CONST.IOU.REQUEST_TYPE.SCAN){// Only skip confirmation when the split is not configurable, for now Smartscanned splits cannot be configuredif(iouType===CONST.IOU.TYPE.SPLIT){IOU.splitBill({
changed the title [-]QAB - Error shows up when submitting split distance expense via split manual shortcut in QAB[/-][+][$250] QAB - Error shows up when submitting split distance expense via split manual shortcut in QAB[/+]on Oct 14, 2024
@mollfpr@slafortune The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Activity
melvin-bot commentedon Oct 13, 2024
Triggered auto assignment to @slafortune (
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.IuliiaHerets commentedon Oct 13, 2024
@slafortune 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
Krishna2323 commentedon Oct 13, 2024
Edited by proposal-police: This proposal was edited at 2024-10-23 09:58:53 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
QAB - Error shows up when submitting split distance expense via split manual shortcut in QAB
What is the root cause of that problem?
The confirmation step is skipped when the request is of any type but the distance request calculations happens on the confirmation.
App/src/pages/iou/request/step/IOURequestStepDistance.tsx
Lines 248 to 325 in e4969b2
The calculations happening on the confirmation page:
App/src/components/MoneyRequestConfirmationList.tsx
Lines 340 to 365 in f251dbc
What changes do you think we should make in order to solve the problem?
iouType === CONST.IOU.TYPE.SPLITis true.if (shouldSkipConfirmation && iouType !== CONST.IOU.TYPE.SPLIT) {.What alternative solutions did you explore? (Optional)
Result
twilight2294 commentedon Oct 14, 2024
Edited by proposal-police: This proposal was edited at 2024-10-21 17:06:08 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
For distance request via split expense for quick actions, we directly create split request instead of distance request and the
BEthrows errorWhat is the root cause of that problem?
When we create a
manualsplit request, and then from quick actions create adistance requestdue toshouldSkipConfirmationbeing true, we create a split request for distance instead of a distance request:App/src/pages/iou/request/step/IOURequestStepDistance.tsx
Lines 247 to 251 in e4969b2
Which in turn gives us API error:

This is because
shouldSkipConfirmationis trueFor quick button actions, we'll skip the confirmation page unless the report is archived or this is a workspace:App/src/pages/iou/request/step/IOURequestStepDistance.tsx
Lines 109 to 110 in e4969b2
So we never considered the case for group chats, and hence we skip the confirmation step and call the wrong api and get error.
What changes do you think we should make in order to solve the problem?
Current
shouldSkipConfirmationdoesn't consider the case for group chats, so we should add a check that we should not skip the confirmation step when we are on group chat:App/src/pages/iou/request/step/IOURequestStepDistance.tsx
Lines 111 to 119 in e4969b2
We should update it to:
Result Video
Screen.Recording.2024-10-14.at.11.51.02.AM.mov
Similar to #47021. The correct solution is to avoid shouldSkipConfirmation=true when moving to a distance request.
What alternative solutions did you explore? (Optional)
We should not skip the confirmation through QAB for split expenses, so we should update the following code and set shouldSkipConfirmation to false:
App/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx
Lines 259 to 261 in e4969b2
App/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx
Lines 262 to 264 in e4969b2
Alternative solution 2:
Like we do on QAB split manual request page, there too
shouldSkipConfirmationis true still we do not skip confirmation page because we have the following check that only callsIOU.splitBillwhen it is a scan request and defaults to confirmation page for manual request:App/src/pages/iou/request/step/IOURequestStepAmount.tsx
Lines 195 to 199 in e4969b2
We will do the same for distance page as well, update the following:
App/src/pages/iou/request/step/IOURequestStepDistance.tsx
Lines 248 to 250 in e4969b2
To:
OR
twilight2294 commentedon Oct 14, 2024
@slafortune , you need to be on P2P distance beta to be able to reproduce this bug, let me know if you are not able to reproduce
slafortune commentedon Oct 14, 2024
Was able to recreate 👍
[-]QAB - Error shows up when submitting split distance expense via split manual shortcut in QAB[/-][+][$250] QAB - Error shows up when submitting split distance expense via split manual shortcut in QAB[/+]melvin-bot commentedon Oct 14, 2024
Job added to Upwork: https://www.upwork.com/jobs/~021845889937723990662
65 remaining items
melvin-bot commentedon Nov 7, 2024
@mollfpr @slafortune The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Krishna2323 commentedon Nov 19, 2024
@garrettmknight this one is ready for payments :)
melvin-bot commentedon Nov 19, 2024
@slafortune, @mollfpr, @neil-marcellini, @Krishna2323 Huh... This is 4 days overdue. Who can take care of this?
abekkala commentedon Nov 19, 2024
Stevies been ooo and returns next week.
I'll make payment summary
abekkala commentedon Nov 19, 2024
PAYMENT SUMMARY FOR NOV 14
abekkala commentedon Nov 19, 2024
@Krishna2323 payment sent and contract ended - thank you! 🎉
garrettmknight commentedon Nov 26, 2024
$250 approved for @mollfpr