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

[Awaiting checklist] [$250] Distance Request -"Distance" option does not appear in QAB for a gmail account #40790

Closed
1 of 6 tasks
lanitochka17 opened this issue Apr 23, 2024 · 52 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

Comments

@lanitochka17
Copy link

lanitochka17 commented Apr 23, 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: 1.4.64-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:
Slack conversation:

Issue found when executing PR #39413

Action Performed:

  1. Open the testing app and login with a gmail account
  2. Submit an expense request using Distance request
  3. Click on FAB menu and select "Record distance" from the QAB

Expected Result:

User should be navigated to the Distance tab

Actual Result:

No Distance tab / user is directed to the Manual request tab

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

Bug6458086_1713825666275.Screen_Recording_2024-04-23_at_1.13.14_AM.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013f4eac573fdf1cb2
  • Upwork Job ID: 1783176218489765888
  • Last Price Increase: 2024-05-01
  • Automatic offers:
    • getusha | Reviewer | 0
    • nkdengineer | Contributor | 0
Issue OwnerCurrent Issue Owner: @getusha
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 23, 2024
Copy link

melvin-bot bot commented Apr 23, 2024

Triggered auto assignment to @twisterdotcom (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

@twisterdotcom 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 #wave-collect - Release 1

@allgandalf
Copy link
Contributor

allgandalf commented Apr 23, 2024

Proposal

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

We show P2P details for submit expense distance even when the user is not under beta

What is the root cause of that problem?

In chat options:

const chatOptions = OptionsListUtils.getFilteredOptions(

We currently only check if the action is not isCategorizeOrShareAction and show the personal contact without checking if p2p beta access is allowed to the user or not:


includePersonalDetails = true,

Note as comments #40790 (comment), P2P distance is still in beta so we need to hide the personal details in this case

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

We have extra checks in place for P2P distance beta already during filtering :

(canUseP2PDistanceRequests || iouRequestType !== CONST.IOU.REQUEST_TYPE.DISTANCE) && !isCategorizeOrShareAction,

(canUseP2PDistanceRequests || iouRequestType !== CONST.IOU.REQUEST_TYPE.DISTANCE) && !isCategorizeOrShareAction,

So we should follow the same pattern and update the !isCategorizeOrShareAction, to !isCategorizeOrShareAction && (canUseP2PDistanceRequests || iouRequestType !== CONST.IOU.REQUEST_TYPE.DISTANCE),

--- a/src/pages/iou/request/MoneyTemporaryForRefactorRequestParticipantsSelector.js
+++ b/src/pages/iou/request/MoneyTemporaryForRefactorRequestParticipantsSelector.js

@@ -124,26 +122,14 @@ function MoneyTemporaryForRefactorRequestParticipantsSelector({participants, onF
             undefined,
             undefined,
             undefined,
-            !isCategorizeOrShareAction,
+            !isCategorizeOrShareAction && (canUseP2PDistanceRequests || iouRequestType !== CONST.IOU.REQUEST_TYPE.DISTANCE),
             isCategorizeOrShareAction ? 0 : undefined,
         );

Result:

@twisterdotcom
Copy link
Contributor

@neil-marcellini keen for your take on this one, so going to make you the internal reviewer ahead of time. I agree though, it's odd to allow a QAB but not direct to it.

40790.mp4

@twisterdotcom twisterdotcom added the External Added to denote the issue can be worked on by a contributor label Apr 24, 2024
@melvin-bot melvin-bot bot changed the title Distance Request -"Distance" option does not appear in QAB for a gmail account [$250] Distance Request -"Distance" option does not appear in QAB for a gmail account Apr 24, 2024
Copy link

melvin-bot bot commented Apr 24, 2024

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

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

melvin-bot bot commented Apr 24, 2024

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

@nkdengineer
Copy link
Contributor

nkdengineer commented Apr 24, 2024

Proposal

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

The user is able to do P2P distance request even though they're not in P2PDistanceRequests beta.

What is the root cause of that problem?

The problem here is not that "Distance" does not show, it's expected that it will not show if the user is not in P2PDistanceRequests beta (the logic is here).

The issue is the user's able to do P2P distance request in the first place, even though they're not in P2PDistanceRequests beta. Once they did the P2P distance request, of course the "Distance" tab will not show when they attempt again, because the user indeed is not in the P2PDistanceRequests beta. To validate that this is right, can just return true in function canUseP2PDistanceRequests and you'll see that this issue doesn't happen.

The issue is the user's able to do P2P distance request in the first place

The root cause of this is the user can still see the personalDetails options that contain individual users, because we don't have any restriction here if the includeP2P is false. As we can see, we have such restriction here, that's why we don't see any 1-1 chat when trying to do "Distance" request.

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

Update this to

const havingLoginPersonalDetails = includeP2P ? options.personalDetails.filter((detail) => !!detail?.login && !!detail.accountID && !detail?.isOptimisticPersonalDetail) : [];

So it will not show any option in Contacts, if includeP2P is false (aka the user is not in P2PDistanceRequests beta)

If there's any other section of options besides personalDetails, that misses this check, we need to add there too.

What alternative solutions did you explore? (Optional)

NA

@suneox
Copy link
Contributor

suneox commented Apr 24, 2024

Proposal

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

The quick action bar shows the "Record distance" option when a request for OneOnOne, so the user can see and select it.

What is the root cause of that problem?

When buildOnyxDataForMoneyRequest we doesn't pass isOneOnOneChat into buildOnyxDataForMoneyRequest so at this lines we have condition to set quick report action

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

We will check condition isOneOnOneChat from report then pass into buildOnyxDataForMoneyRequest

+   const isOneOnOneChat = ReportUtils.isOneOnOneChat(chatReport);
    // STEP 5: Build Onyx Data
    const [optimisticData, successData, failureData] = buildOnyxDataForMoneyRequest(
        chatReport,
        iouReport,
        optimisticTransaction,
        optimisticCreatedActionForChat,
        optimisticCreatedActionForIOUReport,
        iouAction,
        optimisticPersonalDetailListAction,
        reportPreviewAction,
        optimisticPolicyRecentlyUsedCategories,
        optimisticPolicyRecentlyUsedTags,
        isNewChatReport,
        optimisticTransactionThread ?? {},
        optimisticCreatedActionForTransactionThread ?? {},
        shouldCreateNewMoneyRequestReport,
        policy,
        policyTagList,
        policyCategories,
        optimisticNextStep,
+       isOneOnOneChat,
    );

Optional: for out of date data we can hide the quick action menu item at this line when isOneOnOneChat

What alternative solutions did you explore? (Optional)

@getusha
Copy link
Contributor

getusha commented Apr 26, 2024

Reviewing proposals.

@melvin-bot melvin-bot bot added the Overdue label Apr 29, 2024
@neil-marcellini
Copy link
Contributor

I'll take a peek in a bit

@melvin-bot melvin-bot bot removed the Overdue label Apr 29, 2024
@neil-marcellini
Copy link
Contributor

Here's what's happening.

  1. P2P distance requests are still under beta
  2. It's a front end only beta
  3. There's a bug which allows users not on the beta to select individuals for distance requests
  4. The p2p distance request is successfully created
  5. The QAB is successfully updated, but it also properly prevents the user from submitting a distance request to the individual since they aren't on the beta

The solution should be to fix the bug in point 3. I will see if I can find the issue for that. I can't find any other issue like that. Please lmk if you find something, but otherwise let's fix it here.

Screen.Recording.2024-04-29.at.10.14.26.AM.mov

@nkdengineer
Copy link
Contributor

The solution should be to fix the bug in point 3.

@neil-marcellini I agree with this, my proposal is doing just that.

@twisterdotcom
Copy link
Contributor

Alright, shall we assign @nkdengineer?

@allgandalf
Copy link
Contributor

allgandalf commented Apr 29, 2024

Updated Proposal

Updated proposal to match new expectations as per comments

c,c, @getusha @neil-marcellini

@twisterdotcom
Copy link
Contributor

Okay, this is with you then @getusha.

Copy link

melvin-bot bot commented May 1, 2024

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

@getusha
Copy link
Contributor

getusha commented May 1, 2024

@GandalfGwaihir's proposal looks good to me.
🎀 👀 🎀 C+ Reviewed!

Copy link

melvin-bot bot commented May 1, 2024

Current assignee @neil-marcellini is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Jun 11, 2024
@melvin-bot melvin-bot bot changed the title [$250] Distance Request -"Distance" option does not appear in QAB for a gmail account [HOLD for payment 2024-06-18] [$250] Distance Request -"Distance" option does not appear in QAB for a gmail account Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.81-11 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-06-18. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jun 11, 2024

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:

  • [@getusha] The PR that introduced the bug has been identified. Link to the PR:
  • [@getusha] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@getusha] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@getusha] Determine if we should create a regression test for this bug.
  • [@getusha] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@twisterdotcom] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jun 13, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-06-18] [$250] Distance Request -"Distance" option does not appear in QAB for a gmail account [HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] Distance Request -"Distance" option does not appear in QAB for a gmail account Jun 13, 2024
Copy link

melvin-bot bot commented Jun 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.82-4 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-06-20. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jun 13, 2024

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:

  • [@getusha] The PR that introduced the bug has been identified. Link to the PR:
  • [@getusha] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@getusha] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@getusha] Determine if we should create a regression test for this bug.
  • [@getusha] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@twisterdotcom] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 18, 2024
@twisterdotcom
Copy link
Contributor

Payment Summary:

@twisterdotcom twisterdotcom removed the Awaiting Payment Auto-added when associated PR is deployed to production label Jun 20, 2024
@twisterdotcom twisterdotcom changed the title [HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] Distance Request -"Distance" option does not appear in QAB for a gmail account [Awaiting checklist] [$250] Distance Request -"Distance" option does not appear in QAB for a gmail account Jun 20, 2024
@twisterdotcom
Copy link
Contributor

Bump on this checklist @getusha.

@melvin-bot melvin-bot bot added the Overdue label Jun 25, 2024
Copy link

melvin-bot bot commented Jun 25, 2024

@twisterdotcom, @neil-marcellini, @getusha, @nkdengineer Huh... This is 4 days overdue. Who can take care of this?

@twisterdotcom
Copy link
Contributor

Bump @getusha.

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2024
Copy link

melvin-bot bot commented Jul 1, 2024

@twisterdotcom, @neil-marcellini, @getusha, @nkdengineer Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot added the Overdue label Jul 1, 2024
@getusha
Copy link
Contributor

getusha commented Jul 2, 2024

This fell through the cracks, will complete the checklist.

@getusha
Copy link
Contributor

getusha commented Jul 4, 2024

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:

[@getusha] The PR that introduced the bug has been identified. Link to the PR: #40748
[@getusha] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: 2e21c24#r143839908
[@getusha] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/a
[@getusha] Determine if we should create a regression test for this bug. Yes
[@getusha] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Regression Test Proposal

  1. Login with an account that doesn't have P2PDistanceRequests enabled
  2. Go FAB > Submit expense > Distance
  3. Select any waypoint and go to participants page
  4. Verify that contact option/p2p accounts doesn't appear in the list

Do we agree 👍 or 👎

@getusha
Copy link
Contributor

getusha commented Jul 4, 2024

@twisterdotcom accepted the offer, could you end it? ty!

@twisterdotcom
Copy link
Contributor

Done

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
Projects
No open projects
Archived in project
Development

No branches or pull requests

7 participants