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
Distance - Distance field does not show "Pending" after changing distance offline #46952
👋 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:
Identify the pull request that introduced this issue and revert it.
The root cause of the issue is actually not directly related to the PR. We already have a logic here to show Pending... if the distance is 0 or doesn't exist.
The distance comes from either customUnit.quantity or routes.route0.distance. However, when we remove the waypoint, we don't clear the customUnit.quantity.
// We want to reset the amount only for draft transactions (when creating the expense).
// When modifying an existing transaction, the amount will be updated on the actual IOU update operation.
...(isDraft&&{amount: CONST.IOU.DEFAULT_AMOUNT}),
// Empty out errors when we're saving a new waypoint as this indicates the user is updating their input
errorFields: {
route: null,
},
// Clear the existing route so that we don't show an old route
routes: {
route0: {
// Clear the existing distance to recalculate next time
distance: null,
geometry: {
coordinates: null,
},
},
},
});
That's why the issue doesn't happen when adding waypoint while offline. This issue just became apparent after my PR. Previously, we shows Pending when updating the waypoint even if the distance value is already updated. Now, Pending will only show if the distance value is not available yet.
I have open a new PR to address this issue without breaking #43569
Reacted by Pavlo Tsimura, parasharrajat and Neil Marcellini
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!
Activity
melvin-bot commentedon Aug 7, 2024
Triggered auto assignment to @anmurali (
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.melvin-bot commentedon Aug 7, 2024
Triggered auto assignment to @grgia (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.github-actions commentedon Aug 7, 2024
👋 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:
IuliiaHerets commentedon Aug 7, 2024
We think that this bug might be related to #wave-collect - Release 1
trjExpensify commentedon Aug 7, 2024
Discussing with @paultsimura here.
nyomanjyotisa commentedon Aug 7, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Distance field does not show "Pending" after changing distance offline
What is the root cause of that problem?
We don't show "Pending" if
waypointspendingFieldsis updateApp/src/libs/DistanceRequestUtils.ts
Lines 164 to 167 in f9306d5
What changes do you think we should make in order to solve the problem?
show "Pending" if
waypointspendingFieldsis updateAdd new param on
getDistanceForDisplaycalledisPendingUpdatehere and add it in the condition to show Pendingcreate new const to store if
waypointspendingFieldsis update hereThen pass the
isPendingUpdatehereMight need to listen to
pendingFieldsother thenwaypointsif neededAlso might need to show
Pendingfor fields other than distance if needed,What alternative solutions did you explore? (Optional)
9 remaining items
trjExpensify commentedon Aug 7, 2024
Thanks, demoting. @bernhardoj please follow up and fix this!
bernhardoj commentedon Aug 7, 2024
The root cause of the issue is actually not directly related to the PR. We already have a logic here to show Pending... if the distance is 0 or doesn't exist.
App/src/libs/DistanceRequestUtils.ts
Lines 164 to 167 in f9306d5
The distance comes from either
customUnit.quantityorroutes.route0.distance. However, when we remove the waypoint, we don't clear thecustomUnit.quantity.App/src/libs/actions/Transaction.ts
Lines 161 to 191 in f9306d5
But we did remove it when adding waypoints.
App/src/libs/actions/Transaction.ts
Lines 85 to 113 in f9306d5
That's why the issue doesn't happen when adding waypoint while offline. This issue just became apparent after my PR. Previously, we shows Pending when updating the waypoint even if the distance value is already updated. Now, Pending will only show if the distance value is not available yet.
I have open a new PR to address this issue without breaking #43569
melvin-bot commentedon Aug 8, 2024
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
melvin-bot commentedon Aug 30, 2024
This issue has not been updated in over 15 days. @anmurali, @parasharrajat, @grgia, @bernhardoj 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!
bernhardoj commentedon Aug 31, 2024
We can close this one
parasharrajat commentedon Sep 2, 2024
Good to close @anmurali
melvin-bot commentedon Oct 29, 2024
@anmurali, @parasharrajat, @grgia, @bernhardoj, 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.