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
[HOLD for payment 2024-07-24] [$250] Distance - Start and Stop labels do not change when dragging one over another #44153
Note that the Stop label does not change to Start and Start label does not change to stop.
Tap on the Stop row.
Select a waypoint.
Now Stop and Start rows overlap with one another.
Expected Result:
In Step 4, Stop label will change to Start and Start label will change to stop.
Actual Result:
In Step 4, Stop label does not change to Start and Start label does not change to stop.
In Step 7, when selecting a waypoint, Stop and Start rows overlap with one another.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Please re-state the problem that we are trying to solve in this issue.
Distance - Start and Stop labels do not change when dragging one over another
What is the root cause of that problem?
The draggable list requires key for correctly render the items when dragged. When we create draft transaction, there is no key for empty waypoints and due to this the list isn't updated correctly.
Note: We also need to modify the function which checks for duplicate waypoints.
// Remove keyForList list property before using `isEmpty`.constnonEmptyWaypointsCount=useMemo(()=>Object.keys(waypoints).filter((key)=>{const{keyForList, ...waypointWithoutKey}=waypoints[key];return!isEmpty(waypointWithoutKey);}).length,[waypoints],);
What alternative solutions did you explore? (Optional)
We can use math.random to generate random keys when keyForList or other field are not present, we can use isEmpty for that.
changed the title [-]Distance - Start and Stop labels do not change when dragging one over another[/-][+][$250] Distance - Start and Stop labels do not change when dragging one over another[/+]on Jun 24, 2024
changed the title [-][$250] Distance - Start and Stop labels do not change when dragging one over another[/-][+][HOLD for payment 2024-07-24] [$250] Distance - Start and Stop labels do not change when dragging one over another[/+]on Jul 17, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.7-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:
[@hoangzinh] The PR that introduced the bug has been identified. Link to the PR:
[@hoangzinh] 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:
[@hoangzinh] 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:
[@hoangzinh] Determine if we should create a regression test for this bug.
[@hoangzinh] 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.
[@jliexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
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
Activity
melvin-bot commentedon Jun 21, 2024
Triggered auto assignment to @jliexpensify (
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.izarutskaya commentedon Jun 21, 2024
We think this issue might be related to the #collect project.
Krishna2323 commentedon Jun 21, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Distance - Start and Stop labels do not change when dragging one over another
What is the root cause of that problem?
The draggable list requires key for correctly render the items when dragged. When we create draft transaction, there is no key for empty waypoints and due to this the list isn't updated correctly.
App/src/libs/actions/IOU.ts
Lines 339 to 344 in 9817d3c
What changes do you think we should make in order to solve the problem?
We need to make sure that we add keys for empty waypoints too, we can create a const for initial waypoints list.
App/src/pages/iou/request/step/IOURequestStepDistance.tsx
Line 79 in 9817d3c
Note: We also need to modify the function which checks for duplicate waypoints.
What alternative solutions did you explore? (Optional)
We can use math.random to generate random keys when
keyForListor other field are not present, we can useisEmptyfor that.App/src/pages/iou/request/step/IOURequestStepDistance.tsx
Line 440 in 9817d3c
Result
waypoint_drag_issue.mp4
jliexpensify commentedon Jun 24, 2024
I can reproduce, but also have asked the team here if we want to lock down those points, so they can't be dragged.
[-]Distance - Start and Stop labels do not change when dragging one over another[/-][+][$250] Distance - Start and Stop labels do not change when dragging one over another[/+]melvin-bot commentedon Jun 24, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01b23211c128469d40
melvin-bot commentedon Jun 24, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (
External)jliexpensify commentedon Jun 24, 2024
Ok we are good to look at proposals @abdulrahuman5196 , thanks!
30 remaining items
[-][$250] Distance - Start and Stop labels do not change when dragging one over another[/-][+][HOLD for payment 2024-07-24] [$250] Distance - Start and Stop labels do not change when dragging one over another[/+]melvin-bot commentedon Jul 17, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jul 17, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.7-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-07-24. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jul 17, 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:
jliexpensify commentedon Jul 24, 2024
Payment Summary
Upwork job
hoangzinh commentedon Jul 24, 2024
BugZero Checklist:
hoangzinh commentedon Jul 24, 2024
Regression Test Proposal
Do we agree 👍 or 👎
jliexpensify commentedon Jul 25, 2024
Paid and job closed.