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

[Due for payment 2025-02-10] [$250] Distance rates - Dropdown does not show "Enable" after disabling rate while selecting all rates #55052

Closed
6 of 8 tasks
IuliiaHerets opened this issue Jan 10, 2025 · 15 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Jan 10, 2025

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.83-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): applausetester+010108kh@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.0 / Chrome
App Component: Workspace Settings

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Distance rates.
  3. Add one more distance rate if there is only one rate.
  4. Select all rates via checkbox.
  5. Click on the toggle on one of the rates to disable it.
  6. Click on the dropdown button on the top right.

Expected Result:

The dropdown menu will show "Enable" option because now there is a disabled rate (it works this way with categories).

Actual Result:

The dropdown menu does not show "Enable" option after disabling a rate while selecting all rates.
It only appears after reselecting the rates.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6710576_1736485086531.20250110_123206.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021877738099993152916
  • Upwork Job ID: 1877738099993152916
  • Last Price Increase: 2025-01-10
Issue OwnerCurrent Issue Owner: @abekkala
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Jan 10, 2025
Copy link

melvin-bot bot commented Jan 10, 2025

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

Copy link

melvin-bot bot commented Jan 10, 2025

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Jan 10, 2025
Copy link

melvin-bot bot commented Jan 10, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Jan 10, 2025
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.

@nkdengineer
Copy link
Contributor

nkdengineer commented Jan 10, 2025

Edited by proposal-police: This proposal was edited at 2025-01-10 08:28:21 UTC.

Proposal

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

The dropdown menu does not show "Enable" option after disabling a rate while selecting all rates.
It only appears after reselecting the rates.

What is the root cause of that problem?

We are not updating selectedDistanceRates when update distance rate status

const updateDistanceRateEnabled = useCallback(
(value: boolean, rateID: string) => {
if (!customUnit) {
return;
}
const rate = customUnit?.rates?.[rateID];
// Rates can be disabled or deleted as long as in the remaining rates there is always at least one enabled rate and there are no pending delete action
const canDisableOrDeleteRate = Object.values(customUnit?.rates ?? {}).some(
(distanceRate: Rate) => distanceRate?.enabled && rateID !== distanceRate?.customUnitRateID && distanceRate?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
);
if (!rate?.enabled || canDisableOrDeleteRate) {
DistanceRate.setPolicyDistanceRatesEnabled(policyID, customUnit, [{...rate, enabled: value}]);
} else {
setIsWarningModalVisible(true);
}
},
[customUnit, policyID],

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

We can rely on rateID and value in the function updateDistanceRateEnabled to update selectedDistanceRates

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@Gonals
Copy link
Contributor

Gonals commented Jan 10, 2025

#54451 Should have fixed this. Closing

@mountiny
Copy link
Contributor

@Gonals I am not sure if I understand your comment - this was reported on staging and the PR you have linked was deployed to staging now. So it probably did not fix it? Let me know what I am missing and feel free to remove the label and close the issue again

@mountiny mountiny reopened this Jan 10, 2025
@Gonals
Copy link
Contributor

Gonals commented Jan 10, 2025

@Gonals I am not sure if I understand your comment - this was reported on staging and the PR you have linked was deployed to staging now. So it probably did not fix it? Let me know what I am missing and feel free to remove the label and close the issue again

Ah, I think you are right and I misunderstood the purpose of the PR. Looking into this

@Gonals Gonals added the External Added to denote the issue can be worked on by a contributor label Jan 10, 2025
@melvin-bot melvin-bot bot changed the title Distance rates - Dropdown does not show "Enable" after disabling rate while selecting all rates [$250] Distance rates - Dropdown does not show "Enable" after disabling rate while selecting all rates Jan 10, 2025
Copy link

melvin-bot bot commented Jan 10, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 10, 2025
Copy link

melvin-bot bot commented Jan 10, 2025

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

@Gonals
Copy link
Contributor

Gonals commented Jan 10, 2025

@thienlnam, @mountiny, I don't think we need to block deploy on this. It is a new feature (you couldn't really do this flow before the switch) and not very intrusive. That said, it is Friday, so we have until Monday to fix this.

@abzokhattab, @abekkala, this was caused by #54451

@thienlnam
Copy link
Contributor

Looks like I'll be able to deploy today, going to revert it since it is linked to another blocker as well

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Jan 14, 2025
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Feb 3, 2025
@melvin-bot melvin-bot bot changed the title [$250] Distance rates - Dropdown does not show "Enable" after disabling rate while selecting all rates [Due for payment 2025-02-10] [$250] Distance rates - Dropdown does not show "Enable" after disabling rate while selecting all rates Feb 3, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 3, 2025
Copy link

melvin-bot bot commented Feb 3, 2025

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

Copy link

melvin-bot bot commented Feb 3, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.93-3 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 2025-02-10. 🎊

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

  • @paultsimura requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Feb 3, 2025

@paultsimura @abekkala @paultsimura The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

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. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants