Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.48k stars 2.83k forks source link

[$250] Distance - Search results return no results when submitting tracked distance to someone #50495

Open IuliiaHerets opened 1 week ago

IuliiaHerets commented 1 week ago

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.46-4 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): nathanmulugetatesting+1707@gmail.com Issue reported by: Applause Internal Team

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Go to self DM and submit a distance expense
  3. Click on submit it to someone
  4. Search for any users' email

Expected Result:

Users show up in the results

Actual Result:

No users show up and no results found is shown

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/589f2b74-2327-4007-96fd-c476054eb371

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021844352786289436667
  • Upwork Job ID: 1844352786289436667
  • Last Price Increase: 2024-10-17
Issue OwnerCurrent Issue Owner: @ZhenjaHorbach
melvin-bot[bot] commented 1 week ago

Triggered auto assignment to @bfitzexpensify (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 commented 1 week ago

@bfitzexpensify 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

bernhardoj commented 1 week ago

Proposal

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

The submit to someone result is empty.

What is the root cause of that problem?

When we select submit to someone, it should show a user list. However, if the account doesn't have a distance P2P beta, then no user will be shown. (includeP2P is false) https://github.com/Expensify/App/blob/5d25b40eab1416d2d67624a376099853a2b6af86/src/pages/iou/request/MoneyRequestParticipantsSelector.tsx#L130

https://github.com/Expensify/App/blob/5d25b40eab1416d2d67624a376099853a2b6af86/src/libs/OptionsListUtils.ts#L1983-L1986

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

Hide the submit to someone button if the track is a distance and user/account doesn't have the distance P2P beta. https://github.com/Expensify/App/blob/5d25b40eab1416d2d67624a376099853a2b6af86/src/pages/home/report/ReportActionItem.tsx#L418-L455

const {canUseP2PDistanceRequests} = usePermissions();
const [isActionableTrackDistanceRequest] = useOnyx(
    `${ONYXKEYS.COLLECTION.TRANSACTION}${ReportActionsUtils.isActionableTrackExpense(action) ? ReportActionsUtils.getOriginalMessage(action)?.transactionID : -1}`,
    {selector: (transaction) => isDistanceRequest(transaction)},
)
...

if (ReportActionsUtils.isActionableTrackExpense(action)) {
    const transactionID = ReportActionsUtils.getOriginalMessage(action)?.transactionID;
    const actionableButtons = [
        {
            text: 'actionableMentionTrackExpense.categorize', ...,
        }, ...
    ];

    if (canUseP2PDistanceRequests || !isActionableTrackDistanceRequest) {
        actionableButtons.unshift({
            text: 'actionableMentionTrackExpense.submit',
            key: `${action.reportActionID}-actionableMentionTrackExpense-submit`,
            onPress: () => {
                ReportUtils.createDraftTransactionAndNavigateToParticipantSelector(transactionID ?? '0', reportID, CONST.IOU.ACTION.SUBMIT, action.reportActionID);
            },
            isMediumSized: true,
        });
    }

    return actionableButtons;
}
image
melvin-bot[bot] commented 1 week ago

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

melvin-bot[bot] commented 1 week ago

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

ZhenjaHorbach commented 1 week ago

@bernhardoj Thanks for your proposal I will check today or tomorrow !

ZhenjaHorbach commented 1 week ago

@bernhardoj Thanks for your proposal Actually your idea looks good But we need confirmation

@bfitzexpensify What do you think about idea that to hide the submit to someone button if the track is a distance and user/account doesn't have the distance P2P beta ?

melvin-bot[bot] commented 4 days ago

@bfitzexpensify, @ZhenjaHorbach Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] commented 3 days ago

@bfitzexpensify, @ZhenjaHorbach Huh... This is 4 days overdue. Who can take care of this?

ZhenjaHorbach commented 3 days ago

@bfitzexpensify Friendly bump !

melvin-bot[bot] commented 2 days ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸