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

Web - Request Money - Category Not Automatically Added When Requesting Money in Distance Mode #39304

Closed
1 of 6 tasks
kbecciv opened this issue Mar 29, 2024 · 19 comments
Closed
1 of 6 tasks
Assignees
Labels
Engineering Internal Requires API changes or must be handled by Expensify staff Monthly KSv2 Not a priority Reviewing Has a PR in review

Comments

@kbecciv
Copy link

kbecciv commented Mar 29, 2024

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: v1.4.58.0
Reproducible in staging?: y
Reproducible in production?: n
Issue reported by: Applause - Internal Team

Action Performed:

1, Open the FAB menu and select "Request Money."
2, Choose the distance mode option.
3, Enter start and end points, then click "Next."
4, Select workspace chat.
5, Observe that the Category field remains empty and is not automatically filled.

Expected Result:

The Category, labeled as "Car," should be automatically added when requesting money in distance mode.

Actual Result:

The Category field is not automatically populated when requesting money in distance mode.

Workaround:

n/a

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

Bug6432080_1711748047019.Screen_Recording_2024-03-29_at_2.20.44_PM.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01495c58bc9b570f5d
  • Upwork Job ID: 1773872837983576064
  • Last Price Increase: 2024-03-30
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Mar 29, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Mar 29, 2024

Triggered auto assignment to @francoisl (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@kbecciv kbecciv changed the title Request Money - Category Not Automatically Added When Requesting Money in Distance Mode Web - Request Money - Category Not Automatically Added When Requesting Money in Distance Mode Mar 29, 2024
@kbecciv
Copy link
Author

kbecciv commented Mar 29, 2024

We think that this bug might be related to #vip-split

@allgandalf
Copy link
Contributor

Both the policies are different in the video, so one might have default category as car and the other might now, is this really a bug @kbecciv ?? c.c. @francoisl

@francoisl
Copy link
Contributor

I can reproduce the issue, using the same workspace on staging and prod, and the category is being prefilled correctly in production.

@allgandalf
Copy link
Contributor

allgandalf commented Mar 29, 2024

Proposal

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

Category is not automatically show for distance requests

What is the root cause of that problem?

When i console log the customUnits of a policy i see that now we get 2 objects of the name distance:
Screenshot from 2024-03-30 04-38-52

And we have taken the default category condition such that we will store the deafultcategory value without checking if defaultCategory exists : customUnit.name === CONST.CUSTOM_UNITS.NAME_DISTANCE

const defaultCategory = lodashGet(
_.find(lodashGet(policy, 'customUnits', {}), (customUnit) => customUnit.name === CONST.CUSTOM_UNITS.NAME_DISTANCE),
'defaultCategory',
'',
);

And this causes a empty string to be stored as now we have 2 objects with the name distance

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

Add a condition to check if the matching object has defaultCategory field, so the updated query would be:

    const defaultCategory = lodashGet(
        _.find(lodashGet(policy, 'customUnits', {}), (customUnit) => customUnit.name === CONST.CUSTOM_UNITS.NAME_DISTANCE && customUnit.defaultCategory),
        'defaultCategory',
        '',
    );

What alternative solutions did you explore? (Optional)

N/A

@allgandalf
Copy link
Contributor

@francoisl i was able to reproduce the issue, this seems to be the case now that we get 2 objects for the same name distance

@allgandalf
Copy link
Contributor

allgandalf commented Mar 29, 2024

Also reason why this is not reproducible on production is because, we recently changed the default workspace creation from Free to Collect now the response changes to give us 2 objects, you can test this with a free workspace on staging and you will observe that this bug is not reproducible there :)

This is the console log for a free workspace:
image

VS collect workspace:

image

This is NAB i think

@francoisl
Copy link
Contributor

This will be a backend fix, going to remove the label for now.

@francoisl francoisl added Daily KSv2 Internal Requires API changes or must be handled by Expensify staff and removed Hourly KSv2 DeployBlockerCash This issue or pull request should block deployment labels Mar 30, 2024
Copy link

melvin-bot bot commented Mar 30, 2024

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

Copy link

melvin-bot bot commented Mar 30, 2024

Triggered auto assignment to Contributor Plus for review of internal employee PR - @fedirjh (Internal)

@francoisl
Copy link
Contributor

It will be handled internally, no need for a C+ here.

@francoisl francoisl added the Reviewing Has a PR in review label Mar 30, 2024
Copy link

melvin-bot bot commented Apr 8, 2024

@francoisl Huh... This is 4 days overdue. Who can take care of this?

Copy link

melvin-bot bot commented Apr 10, 2024

@francoisl 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

Copy link

melvin-bot bot commented Apr 12, 2024

@francoisl 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

Copy link

melvin-bot bot commented Apr 16, 2024

@francoisl 12 days overdue now... This issue's end is nigh!

@melvin-bot melvin-bot bot removed the Daily KSv2 label Apr 19, 2024
Copy link

melvin-bot bot commented Apr 19, 2024

This issue has not been updated in over 14 days. @francoisl eroding to Weekly issue.

@melvin-bot melvin-bot bot added the Weekly KSv2 label Apr 19, 2024
@melvin-bot melvin-bot bot removed the Weekly KSv2 label May 13, 2024
Copy link

melvin-bot bot commented May 13, 2024

This issue has not been updated in over 15 days. @francoisl eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot added the Monthly KSv2 label May 13, 2024
Copy link

melvin-bot bot commented Jul 10, 2024

@francoisl, this Monthly task hasn't been acted upon in 6 weeks; closing.

If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Internal Requires API changes or must be handled by Expensify staff Monthly KSv2 Not a priority Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

4 participants