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] Distance IOU - Recent appears in the Category list when there is no recent category #28517

Closed
6 tasks done
lanitochka17 opened this issue Sep 29, 2023 · 18 comments
Closed
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 29, 2023

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


Issue found when executing PR #26141

Action Performed:

  1. Go to staging.new.expensify.com and log in as a new user
  2. Create a distance request
  3. Navigate to the distance IOU details page
  4. Click on Category

Expected Result:

'Recent' will not appear in the list since there is no recent category

Actual Result:

'Recent' appears in the list when there is no recent category

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.75-2

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Bug6219294_1696006232063.20230929_234834.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e0113af0faf571ed
  • Upwork Job ID: 1709336174946889728
  • Last Price Increase: 2023-10-03
  • Automatic offers:
    • s77rt | Reviewer | 27012320
    • DylanDylann | Contributor | 27012324
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 29, 2023

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

@melvin-bot
Copy link

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

@shubham1206agra
Copy link
Contributor

Proposal

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

Distance IOU - Recent appears in the Category list when there is no recent category

What is the root cause of that problem?

This is due to default value stored in policyRecentlyUsedCategories_ onyx storage is [""]. Due to which

if (!_.isEmpty(filteredRecentlyUsedCategories)) {
is passing instead of failing due to missing check for this case (when value is [""]).

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

Add condition to filter out blank values, i.e., "" here

_.filter(recentlyUsedCategories, (category) => !_.includes(selectedOptionNames, category)),

as

_.filter(recentlyUsedCategories, (category) => !_.includes(selectedOptionNames, category) && !_.isEmpty(category))

What alternative solutions did you explore? (Optional)

@DylanDylann
Copy link
Contributor

Proposal

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

Distance IOU - Recent appears in the Category list when there is no recent category #28517

What is the root cause of that problem?

When setting policyRecentlyUsedCategories field on ONYX we always put category at the first even though the value of category is empty

const optimisticPolicyRecentlyUsedCategories = [category, ...uniquePolicyRecentlyUsedCategories];

It makes filteredRecentlyUsedCategories in here

const selectedOptionNames = _.map(selectedOptions, (selectedOption) => selectedOption.name);
const filteredRecentlyUsedCategories = _.map(
_.filter(recentlyUsedCategories, (category) => !_.includes(selectedOptionNames, category)),
(category) => ({
name: category,
enabled: lodashGet(categories, `${category}.enabled`, false),
}),

filteredRecentlyUsedCategories === [''] and cause this bug

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

We should update logic here

const optimisticPolicyRecentlyUsedCategories = [category, ...uniquePolicyRecentlyUsedCategories];

We only should put category if it is valuable like this

let optimisticPolicyRecentlyUsedCategories = uniquePolicyRecentlyUsedCategories
    if (category) {
        optimisticPolicyRecentlyUsedCategories = uniquePolicyRecentlyUsedCategories.unshift(category)
    }

Result

Screenshot 2023-10-02 at 14 22 20

@melvin-bot melvin-bot bot added the Overdue label Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

@kevinksullivan Whoops! This issue is 2 days overdue. Let's get this updated quick!

@kevinksullivan kevinksullivan added the External Added to denote the issue can be worked on by a contributor label Oct 3, 2023
@melvin-bot melvin-bot bot changed the title Distance IOU - Recent appears in the Category list when there is no recent category [$500] Distance IOU - Recent appears in the Category list when there is no recent category Oct 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

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

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

melvin-bot bot commented Oct 3, 2023

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

@s77rt
Copy link
Contributor

s77rt commented Oct 4, 2023

@shubham1206agra Thanks for the proposal. I don't think your RCA is correct. Onyx do not have any default values. [""] should not even be stored.

@melvin-bot melvin-bot bot removed the Overdue label Oct 4, 2023
@s77rt
Copy link
Contributor

s77rt commented Oct 4, 2023

@DylanDylann Thanks for the proposal. Your RCA makes sense and the solution looks good to me.

(Can you also please check if same bug exists on tags?)

🎀 👀 🎀 C+ reviewed
Link to proposal

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

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

@DylanDylann
Copy link
Contributor

@s77rt How we can access to Tag page correctly? I use deep link to access to Tag page and see like this
Screenshot 2023-10-04 at 10 20 29

I am not sure if this bug happens for tag page. But from the code, We are doing the same thing like category page.

optimisticPolicyRecentlyUsedTags[tagListKey] = [tag, ...uniquePolicyRecentlyUsedTags];

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

📣 @s77rt 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 4, 2023
@DylanDylann
Copy link
Contributor

@kevinksullivan Are we eligible for compensation for our effort? Contributors are already assigned and started on the PR. It's just due to the other changes and the solution becomes outdated.

cc @s77rt

@s77rt
Copy link
Contributor

s77rt commented Oct 16, 2023

I think 25% would be fair for this case.

@DylanDylann
Copy link
Contributor

DylanDylann commented Oct 19, 2023

The proposal is valid at the time the contributor is assigned and the PR is created. Unfortunately, other change make the proposal is outdated. So I think the payment should be 100% like some other similar cases below:
#26470 (comment)
#26309 (comment)

@DylanDylann
Copy link
Contributor

@kevinksullivan Bump could you help to check above comment?

@kevinksullivan
Copy link
Contributor

Sorry, but our policy is we only pay for completed jobs

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. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants