-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[HOLD for payment 2024-03-06] [$500] [MEDIUM] Distance - Map doesn't load and TBD remains when creating request and editing amount offline #32263
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
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01a40cd0507a4b7824 |
Triggered auto assignment to @greg-schroeder ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws ( |
@izarutskaya Can you please update the video of this issue. |
ProposalPlease re-state the problem that we are trying to solve in this issue.When creating & modifying a Distance request offline, the TBD state is stuck. What is the root cause of that problem?There is a race condition of onSuccess update of the transaction's When creating the request, the "pendingFields": null Line 259 in a56c5cb
And when modifying the amount: "pendingFields": {
"amount": null,
"currency": null
}, Line 799 in a56c5cb
As a result, when coming back online, both operations execute, and the What changes do you think we should make in order to solve the problem?We should reset the "pendingFields": {
"waypoints": null
}, To do this, make the following changes: {
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transaction.transactionID}`,
value: {
pendingAction: null,
pendingFields: _.mapObject(transaction.pendingFields, () => null),
},
}, Lines 254 to 261 in a56c5cb
What alternative solutions did you explore? (Optional)We set the Lines 757 to 766 in cd9cd57
And we handle this state in other places, like here:
We should set this We shouldn't rely on the const isLoading = lodashGet(transaction, 'isLoading', false);
We should also use Line 40 in 61c8b11
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Map doesn't load and TBD remains when creating request and editing amount offline This is bug video bug.mp4I see we have 2 bugs:
What is the root cause of that problem?For the bug 1 App/src/components/ReportActionItem/MoneyRequestView.js Lines 103 to 105 in dad6391
We are setting amount field to TBD if pendingFields.waypoints is valuable
For the bug 2, when creating distance request in successData we set
But after 2 APIs success, the pending field of creating distance request isn't merged to ONYX so What changes do you think we should make in order to solve the problem?For bug 1, I suggest 2 solution:
For the bug 2, I suggest 2 solution:
App/src/libs/actions/Transaction.ts Lines 61 to 63 in 05ae4c4
I am not sure why we add pendingField in saveWaypoint function (this function only merge data to ONYX, not send API). Noe Note that, pendingField only be added in optimisticaData (apply before sending API) and It is re-set in successData and FailureData
|
Will get to this one asap. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Friendly bump @Ollyws :) |
@dukenv0307 Uploaded a video |
Let's get to this one ASAP this week! |
I can no longer reproduce this one. |
@Ollyws @greg-schroeder 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! |
LGTM! |
📣 @Ollyws 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @paultsimura 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
The root cause is that the optimistic data is incorrect. If that root cause is eliminated, there is no concern with success data. As soon as the user confirms the distance request waypoints:add can be removed from pendingFields of the optimistic transaction. There is no need to wait for the API call to return successfully. |
This is incorrect. The waypoints are marked as pending intentionally, and they should remain pending until the |
Actually, I believe that as soon as the user confirms the choice of waypoints, they are no longer "pending" in the user's mind. Pending waypoints are useful up until the time that the user confirms them to be correct and complete, which happens prior to the CreateDistanceRequest API call. |
Thanks. The PR is ready for review: #37009 |
This was deployed to prod 2/28, so payment date will be 3/6 |
Hmm. The upwork job was closed for some reason, even though there was recent activity. I don't know. I'll probably have to create a new one... |
@greg-schroeder it's weird because the offer is still active for me on Upwork 🤔 |
Apologies, I was out yesterday, but I'll generate a new job today and get this done |
Doing |
@paultsimura paid! @Ollyws can you accept the offer we sent you? I'll pay you as soon as you accept |
Accepted, thanks! |
cool, paid |
Uh oh!
There was an error while loading. Please reload this page.
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: v1.4.5-7
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause-Internal Tean
Slack conversation: @
Action Performed:
Expected Result:
The map will load and the fields with TBD will load data when the network connection is regained.
Actual Result:
The map never loads and all the details remain TBD.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6295871_1701345082560.bandicam_2023-11-30_09-31-22-433.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: