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

[HOLD for payment 2023-10-09] [$500] [Distance] - Ability to request money without filling start and finish points #27383

Closed
1 of 6 tasks
kbecciv opened this issue Sep 13, 2023 · 57 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Sep 13, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Request money -> distance
  2. Change /distance in the URL to /participants
  3. Choose a workspace then click request

Expected Result:

The app should redirect the user to https://staging.new.expensify.com/request/new/distance

Actual Result:

The app allows users to request money

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.69.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
Notes/Photos/Videos: Any additional supporting documentation

participants-bug.webm
Recording.4449.mp4

Expensify/Expensify Issue URL:
Issue reported by: @hichamcc
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694429194889109

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01bf360a8a0ff38420
  • Upwork Job ID: 1702018479558987776
  • Last Price Increase: 2023-09-20
  • Automatic offers:
    • DylanDylann | Contributor | 26773601
@kbecciv kbecciv 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 Sep 13, 2023
@dukenv0307
Copy link
Contributor

Proposal

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

[Distance] Ability to request money without filling start and finish points

What is the root cause of that problem?

We don't allow user to back to the first step if the request is a distance request

if (!isDistanceRequest && ((props.iou.amount === 0 && !props.iou.receiptPath) || shouldReset)) {

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

We should remove the check !isDistanceRequest to make user can reset to the first step

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot changed the title [Distance] - Ability to request money without filling start and finish points [$500] [Distance] - Ability to request money without filling start and finish points Sep 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 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 Sep 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 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

@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

Triggered auto assignment to @tjferriss (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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

@DylanDylann
Copy link
Contributor

Proposal

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

Ability to request money without filling start and finish points

What is the root cause of that problem?

if (!isDistanceRequest && ((props.iou.amount === 0 && !props.iou.receiptPath) || shouldReset)) {
navigateBack(true);
}

if (!isDistanceRequest && props.iou.id) {
navigateBack(true);
}

Let's see this code, we only navigate back if itn't distance request. It seems that we want to prevent user come back in distance request

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

We should update the logic to allow users:

  1. Coming back if it isn't distance request
  2. Coming back if it is distance request and there are no waypoint (no route)

To do that we can get waypoint from transaction like this

const transaction = TransactionUtils.getTransaction(props.iou.transactionID);
const isEmptyWaypoint = _.isEmpty(lodashGet(transaction, 'comment.waypoint.waypoint0', {}))

and in here

if (!isDistanceRequest && ((props.iou.amount === 0 && !props.iou.receiptPath) || shouldReset)) {
navigateBack(true);
}

if (!isDistanceRequest && props.iou.id) {
navigateBack(true);
}

update the condition to

(!isDistanceRequest || (isDistanceRequest && isEmptyWaypoint))

instead of only !isDistanceRequest

What alternative solutions did you explore? (Optional)

Same like the main solution but we can use isEmptyRoute instead of isEmptyWaypoint

const isEmptyWaypoint = _.isEmpty(lodashGet(transaction, 'comment.routes', {}))

@joekaufmanexpensify
Copy link
Contributor

@tjferriss I'll grab this one as you were the second assignee, and this issue doesn't need two BZ assignees.

@joekaufmanexpensify
Copy link
Contributor

Reproduced and agreed that this is a bug. Makes sense to me that we'd just redirect back to https://staging.new.expensify.com/request/new/distance, as that's what we seem to do for manual and scan in this same exact scenario.

CC @neil-marcellini in case you have thoughts on this.

@joekaufmanexpensify
Copy link
Contributor

Proposals pending review.

@joekaufmanexpensify
Copy link
Contributor

Same

@joekaufmanexpensify
Copy link
Contributor

@allroundexperts Could you please take a look at the proposals on this issue? TY!

@allroundexperts
Copy link
Contributor

allroundexperts commented Sep 19, 2023

Thanks for your proposal @dukenv0307. In this case, I think its more safer to redirect the user back based on waypoints rather than the amount. This is also what we use when deciding to fetch a route (so its better for consistency as well). As such, I think @DylanDylann's proposal is better.

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Sep 19, 2023

Triggered auto assignment to @roryabraham, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@roryabraham roryabraham changed the title [$500] [Distance] - Ability to request money without filling start and finish points [$100] [Distance] - Ability to request money without filling start and finish points Sep 20, 2023
@melvin-bot

This comment was marked as outdated.

@roryabraham roryabraham changed the title [$100] [Distance] - Ability to request money without filling start and finish points [$500] [Distance] - Ability to request money without filling start and finish points Sep 20, 2023
@melvin-bot

This comment was marked as outdated.

@melvin-bot

This comment was marked as outdated.

@joekaufmanexpensify
Copy link
Contributor

Great, ty! Changing this to weekly then in the meantime.

@joekaufmanexpensify joekaufmanexpensify added Weekly KSv2 and removed Daily KSv2 labels Oct 9, 2023
@joekaufmanexpensify
Copy link
Contributor

Still held

@joekaufmanexpensify
Copy link
Contributor

Held

@joekaufmanexpensify
Copy link
Contributor

Same

@joekaufmanexpensify
Copy link
Contributor

Follow up PR is merged and should be deployed this week!

Copy link

melvin-bot bot commented Nov 7, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

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.

@joekaufmanexpensify
Copy link
Contributor

@allroundexperts I see the PR this one was held on got deployed. We can make more progress on this now. Is that right?

@allroundexperts
Copy link
Contributor

Yep, we can proceed now. I'm not sure if the second PR caused the regression or not. @DylanDylann Can you please confirm?

@DylanDylann
Copy link
Contributor

@allroundexperts Yep, but It seems the regression is fixed by another PR

@allroundexperts
Copy link
Contributor

Okay. So it seems this caused 2 regressions. So just a note that the payment should be 1/4.

@DylanDylann
Copy link
Contributor

@allroundexperts The first regression is not caused our PR. You can check this comment for more detail

@allroundexperts
Copy link
Contributor

Gotcha so half it is then!

@joekaufmanexpensify
Copy link
Contributor

Got it. And #28308 was the only thing remaining for this issue, so we're good to do BZ checklist now, issue payment (after 7 day hold) and close?

@allroundexperts
Copy link
Contributor

Correct @joekaufmanexpensify.

@joekaufmanexpensify
Copy link
Contributor

Sweet. Mind taking care of your portion of the BZ checklist?

@joekaufmanexpensify
Copy link
Contributor

bumped in slack

@allroundexperts
Copy link
Contributor

Checklist

  1. Modify MoneyRequestConfirmPage for Distance Request #25707
  2. https://github.com/Expensify/App/pull/25707/files#r1399807663
  3. I think better testing would have caught this. We already have a point about deep links in the checklist. As such, discussion on Slack is not needed.
  4. A regression test would help.

Regression Test

  1. Request money -> distance
  2. Change /distance in the URL to /participants

Verify that you are redirected to the new distance request page.

Do we 👍 or 👎 ?

@joekaufmanexpensify
Copy link
Contributor

Great, ty! BZ checklist is all set.

@joekaufmanexpensify
Copy link
Contributor

All set to issue payment. There was a regression here, so the county due here is:

@joekaufmanexpensify
Copy link
Contributor

@DylanDylann $250 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

Upwork job is closed, so opened new one to pay @hichamcc: https://www.upwork.com/jobs/~01282aaf23d83dd5cc

@joekaufmanexpensify
Copy link
Contributor

@hichamcc offer sent for $50!

@joekaufmanexpensify
Copy link
Contributor

@allroundexperts could you please request $250 via NewDot and confirm here once done?

@joekaufmanexpensify
Copy link
Contributor

@hichamcc $50 sent and contract ended!

@JmillsExpensify
Copy link

$250 payment approved for @allroundexperts based on this comment.

@joekaufmanexpensify
Copy link
Contributor

Great! Closing as this is all set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants