You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[PAID] [$250] Distance rates - Distance rate order in Rate page is random after clear cache and restart app #50304
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorMonthlyKSv2
Version Number: 9.0.45-2 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers):applausetester+kh0410007@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Go to staging.new.expensify.com
Go to workspace settings > Distance rates
Add a few distance rates
Go to workspace chat.
Click + > Submit expense > Distance.
Enter waypoints > Next.
Click Rate on confirmation page.
Note that order of distance rates is A, B, C, D, E etc
Go to Troubleshoot > Clear cache and restart
Select Reset and refresh
Repeat Step 4 to 7.
Expected Result:
The order of distance rates in Rate page should remain A, B, C, D, E etc.
Actual Result:
The order of distance rates in Rate page is random after clear cache and restart app.
@CortneyOfstad 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
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.
My proposal provides the correct sorting function first (using the same approach as in PolicyDistanceRatesPage). @ChavdaSachin had the same idea but made his update after I submitted my proposal
Bringing the sorting logic into the getMileageRates function has no impact. It’s more complicated than my proposal but doesn’t offer any additional benefits
@cretadn22 thanks for your insights,
But I believe Proposals are about sharing ideas how a problem could be solved isn't it?
And I believe sorting is not any sort of complex problem where it's must to share pseudo code to make reviewer believe in your solution.
But anyways I will respect whatever thought reviewer might have.
changed the title [-][$250] Distance rates - Distance rate order in Rate page is random after clear cache and restart app[/-][+][HOLD for payment 2024-10-25] [$250] Distance rates - Distance rate order in Rate page is random after clear cache and restart app[/+]on Oct 18, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.50-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
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:
[@paultsimura] The PR that introduced the bug has been identified. Link to the PR:
[@paultsimura] 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:
[@paultsimura] 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:
[@paultsimura] Determine if we should create a regression test for this bug.
[@paultsimura] 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.
[@CortneyOfstad / @trjExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
The PR that introduced the bug has been identified. Link to the PR: N/A
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: N/A
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
Determine if we should create a regression test for this bug: Yes
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
Note: This is a beta feature, so enable canUseP2PDistanceRequests beta before proceeding.
Go to workspace settings > Distance rates
Add a few distance rates
Verify they are sorted based on the rate values in ascending order.
Go to a workspace chat.
Click + > Submit expense > Distance.
Enter waypoints > Next.
Click Rate on the confirmation page.
Verify that the Distance rates are sorted based on the rate values in ascending order.
Submit the request
Navigate to the request details page
Click "Rate" to open the rate editor
Verify that the Distance rates are always sorted based on the rate values in ascending order.
changed the title [-][HOLD for payment 2024-10-25] [$250] Distance rates - Distance rate order in Rate page is random after clear cache and restart app[/-][+][PAID] [$250] Distance rates - Distance rate order in Rate page is random after clear cache and restart app[/+]on Oct 25, 2024
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorMonthlyKSv2
Activity
melvin-bot commentedon Oct 6, 2024
Triggered auto assignment to @CortneyOfstad (
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.IuliiaHerets commentedon Oct 6, 2024
We think that this bug might be related to #wave-collect - Release 1
IuliiaHerets commentedon Oct 6, 2024
@CortneyOfstad 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
ChavdaSachin commentedon Oct 6, 2024
Edited by proposal-police: This proposal was edited at 2024-10-06 17:30:16 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Distance rate order in Rate page is random after clear cache and restart app
What is the root cause of that problem?
We are not sorting distanceRates here.
App/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx
Line 67 in 99f280b
While we do sort rates on
PolicyDistanceRatesPagehere.App/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx
Lines 102 to 106 in 99f280b
What changes do you think we should make in order to solve the problem?
Implement sorting after reading rates from ONYX here.
App/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx
Line 67 in 99f280b
Implement sorting similar to
PolicyDistanceRatesPageWhat alternative solutions did you explore? (Optional)
Alternatively we could implement sorting in
getMileageRatesfunction here instead of sorting onIOURequestStemDistancePage.App/src/libs/DistanceRequestUtils.ts
Line 36 in 99f280b
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.
cretadn22 commentedon Oct 6, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Distance rate order in Rate page is random after clear cache and restart app
What is the root cause of that problem?
We don't currently sort the distance rate list in IOURequestStepDistanceRate.
App/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx
Lines 73 to 78 in 99f280b
What changes do you think we should make in order to solve the problem?
We need to sort the distance rate list in IOURequestStepDistanceRate, similar to how it's done in PolicyDistanceRatesPage.
App/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx
Line 105 in 99f280b
What alternative solutions did you explore? (Optional)
ChavdaSachin commentedon Oct 6, 2024
Updated Proposal
Updated Proposal added alternate solution.
cretadn22 commentedon Oct 6, 2024
Note for the reviewer:
My proposal provides the correct sorting function first (using the same approach as in PolicyDistanceRatesPage). @ChavdaSachin had the same idea but made his update after I submitted my proposal
Bringing the sorting logic into the getMileageRates function has no impact. It’s more complicated than my proposal but doesn’t offer any additional benefits
ChavdaSachin commentedon Oct 6, 2024
@cretadn22 thanks for your insights,
But I believe Proposals are about sharing ideas how a problem could be solved isn't it?
And I believe sorting is not any sort of complex problem where it's must to share pseudo code to make reviewer believe in your solution.
But anyways I will respect whatever thought reviewer might have.
nkdengineer commentedon Oct 7, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The order of distance rates in Rate page is random after clear cache and restart app.
What is the root cause of that problem?
When we add new distances, these objects are added to Onyx in turn then this displays the current order that we added is
A, B, C, D, EApp/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx
Line 73 in 6d8e739
After we reset the cache and restarted, BE returned another order of
ratesobject then it displayed in a different orderApp/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx
Line 73 in 6d8e739
What changes do you think we should make in order to solve the problem?
Sort the distance rates by
ratevalue as we do hereApp/src/pages/iou/request/step/IOURequestStepDistanceRate.tsx
Lines 73 to 75 in 6d8e739
What alternative solutions did you explore? (Optional)
NA
melvin-bot commentedon Oct 9, 2024
@CortneyOfstad Whoops! This issue is 2 days overdue. Let's get this updated quick!
35 remaining items
[-][$250] Distance rates - Distance rate order in Rate page is random after clear cache and restart app[/-][+][HOLD for payment 2024-10-25] [$250] Distance rates - Distance rate order in Rate page is random after clear cache and restart app[/+]melvin-bot commentedon Oct 18, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Oct 18, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.50-8 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-10-25. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Oct 18, 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:
paultsimura commentedon Oct 21, 2024
This can be treated as a feature request.
The PR that introduced the bug has been identified. Link to the PR:N/AThe 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:N/ARegression Test Proposal
Note: This is a beta feature, so enable
canUseP2PDistanceRequestsbeta before proceeding.Do we agree 👍 or 👎
CortneyOfstad commentedon Oct 24, 2024
I'm back from OoO — thanks for holding down the fort @trjExpensify!
Agree with your proposal @paultsimura!
CortneyOfstad commentedon Oct 25, 2024
Payment Summary
@paultsimura — paid $250 via Upwork
@ChavdaSachin — paid $250 via Upwork
Regression Test
https://github.com/Expensify/Expensify/issues/439059
[-][HOLD for payment 2024-10-25] [$250] Distance rates - Distance rate order in Rate page is random after clear cache and restart app[/-][+][PAID] [$250] Distance rates - Distance rate order in Rate page is random after clear cache and restart app[/+]