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

[$500] Workspace - Manual request is created when splitting bill using FAB button #33014

Closed
6 tasks done
lanitochka17 opened this issue Dec 13, 2023 · 8 comments
Closed
6 tasks done
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 Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Dec 13, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.12-0
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Click FAB > Request money > Manual
  3. Enter an amount > Next
  4. Click Split next to the workspace chat
  5. Proceed to confirmation page
  6. Create the request

Expected Result:

The bill split is created in the workspace chat

Actual Result:

Manual expense is created instead of bill split when it is done from FAB button

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

Bug6312192_1702499090439.20231214_041839.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01aa50518aa43c0a7e
  • Upwork Job ID: 1735035425410666496
  • Last Price Increase: 2023-12-13
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 13, 2023
@melvin-bot melvin-bot bot changed the title Workspace - Manual request is created when splitting bill using FAB button [$500] Workspace - Manual request is created when splitting bill using FAB button Dec 13, 2023
Copy link

melvin-bot bot commented Dec 13, 2023

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

Copy link

melvin-bot bot commented Dec 13, 2023

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

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

melvin-bot bot commented Dec 13, 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

Copy link

melvin-bot bot commented Dec 13, 2023

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

@neonbhai
Copy link
Contributor

neonbhai commented Dec 13, 2023

Proposal

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

Manual request is created when splitting bill using FAB button

What is the root cause of that problem?

The bug is we cannot make split request with a single participant because of this line:

const nextStepIOUType = numberOfParticipants.current === 1 ? iouType : CONST.IOU.TYPE.SPLIT;

Since number of participants is 1 for splitting with 1 person, manual request will be made, and the request will not be split.

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

We should pass separate functions for manual request and split request, like we did in the old participants selector

Manual Requests are triggered with onSelectRow, which should navigate to manual request

Split Requests are triggered with onConfirmSelection triggered by the green button. All requests triggered by the button should be navigated to split request.

const goToNextStep = useCallback((isNextStepSplit = false) => {
    const nextStepIOUType = isNextStepSplit ? CONST.IOU.TYPE.SPLIT : iouType;
    ...
}
const confirmSplitRequest = useCallback(() => {
    onFinish(isNextStepSplit: true);
}

onConfirmSelection={() => confirmSplitRequest()}

Alternatively

We can separate the onFinish() function to navigate to the required step using two different functions like in old Participants Selector:

/** Callback to request parent modal to go to next step, which should be request */
navigateToRequest: PropTypes.func.isRequired,
/** Callback to request parent modal to go to next step, which should be split */
navigateToSplit: PropTypes.func.isRequired,

We can separate the onFinish() function to navigate to the required step using two different function like in old Participants Selector:

/** Callback to request parent modal to go to next step, which should be request */
navigateToRequest: PropTypes.func.isRequired,
/** Callback to request parent modal to go to next step, which should be split */
navigateToSplit: PropTypes.func.isRequired,

In this change we will seperate onFinish to two functions onFinishManualRequest() and onFinishSplitRequest()

const onFinishSplitRequest = useCallback(() => {
    Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(CONST.IOU.TYPE.SPLIT, 
transactionID, selectedReportID.current || reportID));
}, [iouType, transactionID, reportID]);
const onFinishManualRequest = useCallback(() => {
    Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(iouType, transactionID, 
selectedReportID.current || reportID));
}, [iouType, transactionID, reportID]);

@yh-0218
Copy link
Contributor

yh-0218 commented Dec 13, 2023

Proposal

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

Workspace - Manual request is created when splitting bill using FAB button

What is the root cause of that problem?

The bug is we cannot make split request with a single participant because of this line:

const nextStepIOUType = numberOfParticipants.current === 1 ? iouType : CONST.IOU.TYPE.SPLIT;

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

numberOfParticipants.current = val.length;

Here we don't need save length.
We need to save newIouType here.

If val.length > 1, newIouType = CONST.IOU.TYPE.SPLIT.
if val.length === 1 && val. isPolicyExpenseChat, newIouType = CONST.IOU.TYPE.SPLIT
else newIouType = iouType

and navigate

Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(newIouType, transactionID, selectedReportID.current || reportID));

Result

Screen.Recording.2023-12-14.at.12.27.25.AM.mov

@bernhardoj
Copy link
Contributor

This will be handled here

@joekaufmanexpensify
Copy link
Contributor

Sounds good. Closing since this is a dupe

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 Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

6 participants