-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$250] Distance-Distance field is stuck on pending... and no error shown when updating of waypoints fails #52248
Comments
Triggered auto assignment to @bfitzexpensify ( |
This comment was marked as outdated.
This comment was marked as outdated.
Job added to Upwork: https://www.upwork.com/jobs/~021854958931528313891 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh ( |
ProposalPlease re-state the problem that we are trying to solve in this issueThe distance field does not show "Pending" when editing the distance by swapping in offline mode. What is the root cause of that problem?The This is where the function is called and the App/src/libs/TransactionUtils/index.ts Lines 694 to 696 in 533aed6
In our case the first condition always passes because in The reason why the second condition passes as well is because the What changes do you think we should make in order to solve the problem?In function updateWaypoints(transactionID: string, waypoints: WaypointCollection, isDraft = false): Promise<void | void[]> {
return Onyx.merge(`${isDraft ? ONYXKEYS.COLLECTION.TRANSACTION_DRAFT : ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {
comment: {
waypoints,
customUnit: null, // <- Add this line
},
... This change will also account for the following case of distance expense confirmation while offline: Distance Cofirmation Change - OfflineScreen.Recording.2024-11-08.at.14.28.09.movSolution resultMacOS: ChromeScreen.Recording.2024-11-08.at.14.17.42.mov |
Thanks for your proposals @FitseTLT @ikevin127. @ikevin127 provided a more thorough root cause than @FitseTLT, I couldn't understand the root cause without your proposal. However, I lean towards to @FitseTLT solution, I think we only need to optimistic set
is enough to fix our issue. |
@hoangzinh Thanks for the feedback, however, regarding your decision, quoting from the proposal template (code):
I thought we cannot hire a contributor who's proposal's RCA is not clear enough, in this case I'd expect the proposal that provided a clear RCA and working solution to be assigned. My bad, I didn't know that there are exceptions to those rules. I'll make sure to avoid issues reviewed by you in the future since I usually post proposals with those rules in mind 👍 |
I think this issue has pretty clear RCA that's why I put a concise proposal.
and the obsolete customUnit data should be cleared and that is what we do for saveWaypoints which I mentioned in my proposal (that's why the problem doesn't occur if we change or add a waypoint from IOURequestStepWaypoint) I would have made the review's job easier if I put more detail, I'm sorry about that 🙏 , but I thought it was pretty straightforward. |
No worry @ikevin127. If it's a guideline, we should follow it and avoid exceptions as much as possible. Tbh, I haven't made any decisions here yet. And because I haven't been satisfied with any proposals, I just shared my thoughts. |
quoting from the proposal template (code):
Hmm. Tbh, it's hard to define minimum. @FitseTLT's root cause is correct but not "minimum" to me. @FitseTLT, can you add more details to your RCA? Thank you. |
@hoangzinh Updated |
@ikevin127 As I mentioned here, your RCA looks great but your solution doesn't look good to me. I think if we go down with that approach, we should update the minimum data that can solve our issue. Update more data than we need, it will potentially clear data in somewhere. |
There is more data in App/src/types/onyx/Transaction.ts Lines 89 to 94 in 533aed6
We can't be clearing customUnitRateID , for instance.
|
@hoangzinh It doesn't matter anymore since I just noticed that the same code suggested in the first proposal's solution was just merged in PR: return Onyx.merge(`${isDraft ? ONYXKEYS.COLLECTION.TRANSACTION_DRAFT : ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {
comment: {
waypoints,
+ customUnit: {
+ quantity: null,
+ },
}, which means our issue is not reproducible anymore on dev and soon won't be reproducible on staging either once the PR will be deployed. If you really want a complete solution for this issue, you'd have to look deeper into what happens in the edge case where editing distance call fails. Here's a comparison of the transaction related
Notice the
|
Editing Date - Failed Request | Editing Date - Failed Request (with current fix) |
---|---|
Screen.Recording.2024-11-11.at.15.26.47.mov |
Screen.Recording.2024-11-11.at.15.23.29.mov |
Note: We did not have anything in place before the fix anyway, but at least before the fix the Distance would show the previous data in case the API call failed.
It's a great finding @ikevin127. cc @bfitzexpensify TLDR; the original issue is fixed in this PR. But @ikevin127 found another edge case here that makes "Pending" status still show even the API call is failed. What do you think if we should fix it in this issue? |
Let's fix it! |
@ikevin127 do you mind updating your proposal again? including the problem you want to solve, RC + solution. Thank you. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@hoangzinh @bfitzexpensify This one is complicated, I looked into it for a few hours but I wasn't able to come up with a fix. Maybe we can raise the bounty to get more eyes on the issue and even update the description for clarity. |
Thanks @ikevin127. @bfitzexpensify, what do you think? If we still want to solve this edge-case issue, I guess we need to update the issue's title + description, then wait for a few days to get more eyes on it. |
@hoangzinh @bfitzexpensify this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
@hoangzinh, @bfitzexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Thanks @FitseTLT. I will review it soon. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@FitseTLT is it possible to show errors for users to know if updating distance is failed? |
2024-11-26.00-00-56.mp4 |
Yes Thanks @hoangzinh you are right looks like the backend sets
|
Do you mind to share recordings of option 1 & 2? @FitseTLT |
@hoangzinh Option 1 will be exactly as here and option 2 will only revert the value without showing error. |
@FitseTLT proposal looks good to me Link to proposal #52248 (comment) 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @pecanoro, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@bfitzexpensify please change the title of the issue to |
Sounds good! Assigning @FitseTLT |
📣 @FitseTLT 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Issue not reproducible during KI retests. (First week) |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.0.59-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
The distance field will change to "Pending" when editing the distance by swapping in offline mode.
Actual Result:
The distance field does not show "Pending" when editing the distance by swapping in offline mode.
It shows the same amount but it is grayed out.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6658691_1731061670854.20241108_182248.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @hoangzinhThe text was updated successfully, but these errors were encountered: