-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD for payment 2024-11-11] [$250] Distance - Receipt disappears when dismissing distance editor after receipt is generated #48630
Comments
Triggered auto assignment to @isabelastisser ( |
Edited by proposal-police: This proposal was edited at 2024-09-09 05:24:30 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.The receipt in the transaction thread turns to placeholder thumbnail. What is the root cause of that problem?When we open the distance page, the transaction backup data has no route data. After BE returns the data, App/src/pages/iou/request/step/IOURequestStepDistance.tsx Lines 186 to 192 in d3c995a
What changes do you think we should make in order to solve the problem?We should check if at the time we open the distance page, we don't have the route data and at the time we close the page, we have the route data, and we will not revert the transaction to transaction backup data
App/src/pages/iou/request/step/IOURequestStepDistance.tsx Lines 186 to 192 in d3c995a
What alternative solutions did you explore? (Optional) |
Job added to Upwork: https://www.upwork.com/jobs/~021832157502208534261 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 ( |
This comment was marked as outdated.
This comment was marked as outdated.
@nkdengineer Thanks for the proposal. I was able to reproduce the issue but I'm struggling with applying the solution, specifically the changes suggested at step 3 and without that the issue is still reproducible therefore I cannot verify the proposal. Are you able to provide a testing branch with the working solution ? That would help verifying the solution and if the RCA matches the working solution then I would be able to finalize the proposal review. Thanks! |
@ikevin127 Ahh, sorry I proposed another bug. Updated my proposal for the original bug. |
@nkdengineer Thanks for the update, I tested the solution and while it seems to fix the issue at first - the solution is not reliable because is breaking functionality that was working as expected before the change:
VideoScreen.Recording.2024-09-10.at.18.mp4Additionally, while going back online with the RHP open I had instances where the map receipt in the background report would show 404 not found: I think a solution that would be acceptable for this issue should not break functionality that currently works well. In addition, if proposing changes to currently existing code logic, some steps should be included for the reviewers to verify that current functionality is not affected by the proposed changes. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Waiting for new proposals! |
💰 Looking for proposals! Please keep in mind the previous proposal's pitfalls detailed in #48630 (comment) review. |
@isabelastisser, @ikevin127 Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Still waiting for proposals. |
💰 Still looking for proposals! Please keep in mind the previous proposal's pitfalls detailed in #48630 (comment) review. |
@isabelastisser @ikevin127 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! |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Receipt disappears when dismissing distance editor after it is generated. What is the root cause of that problem?TransactionBackup routes are not being updated when online, causing the receipt route to disappear when the modal is dismissed. What changes do you think we should make in order to solve the problem?This solution will require backend modifications. Calculate transaction backup routes when there are pending waypoints, valid routes, and the system is online. Create new API endpoint similar to GET_ROUTE_FOR_BACKUP: 'GetRouteForBackup', Add new type to define transactionStates TRANSACTION_STATE: {
CURRENT: 'current',
DRAFT: 'draft',
BACKUP: 'backup',
} modify export default function useFetchRoute(transaction: OnyxEntry<Transaction>, waypoints: WaypointCollection | undefined, action: IOUAction, transactionState: TransactionState = CONST.TRANSACTION_STATE.CURRENT) {
...............
useEffect(() => {
if (isOffline || !shouldFetchRoute || !transaction?.transactionID) {
return;
}
TransactionAction.getRoute(transaction.transactionID, validatedWaypoints, transactionState);
}, [shouldFetchRoute, transaction?.transactionID, validatedWaypoints, isOffline, action]); Modify function getOnyxDataForRouteRequest(transactionID: string, transactionState: TransactionState = CONST.TRANSACTION_STATE.CURRENT): OnyxData {
let keyPrefix;
switch (transactionState) {
case CONST.TRANSACTION_STATE.DRAFT:
keyPrefix = ONYXKEYS.COLLECTION.TRANSACTION_DRAFT;
break;
case CONST.TRANSACTION_STATE.BACKUP:
keyPrefix = ONYXKEYS.COLLECTION.TRANSACTION_BACKUP;
break;
case CONST.TRANSACTION_STATE.CURRENT:
default:
keyPrefix = ONYXKEYS.COLLECTION.TRANSACTION;
break;
}
....
function getRoute(transactionID: string, waypoints: WaypointCollection, routeType: TransactionState = CONST.TRANSACTION_STATE.CURRENT) {
if (routeType === CONST.TRANSACTION_STATE.BACKUP)
{
mockGetBackupRoute(transactionID);
}
const parameters: GetRouteParams = {
transactionID,
waypoints: JSON.stringify(waypoints),
};
let command;
switch (routeType) {
case 'draft':
command = READ_COMMANDS.GET_ROUTE_FOR_DRAFT;
break;
case 'current':
command = READ_COMMANDS.GET_ROUTE;
break;
case 'backup':
command = READ_COMMANDS.GET_ROUTE_FOR_BACKUP;
break;
default:
throw new Error('Invalid route type');
}
....... Adjust useFetchRoute usage: useFetchRoute(transaction, transaction?.comment?.waypoints, action, IOUUtils.shouldUseTransactionDraft(action) ? CONST.TRANSACTION_STATE.DRAFT : CONST.TRANSACTION_STATE.CURRENT); call const backupWaypoints = !!transactionBackup?.pendingFields?.waypoints ? transactionBackup?.comment?.waypoints : undefined;
const { shouldFetchRoute, validatedWaypoints } = useFetchRoute(transaction, waypoints, action, IOUUtils.shouldUseTransactionDraft(action) ? CONST.TRANSACTION_STATE.DRAFT : CONST.TRANSACTION_STATE.CURRENT);
useFetchRoute(transactionBackup, backupWaypoints, action, CONST.TRANSACTION_STATE.BACKUP); What alternative solutions did you explore? (Optional)N/A |
Re-testing && creating the PR.... |
@Gonals what is the API name? is it |
Ah, seems dev server doesn't have that API, the API exists after switch to staging @ikevin127 @Gonals Please confirm that the scope of this issue is only to restore the map If the user go back without save the transaction, some fields would still missing. (e.g. merchant, customUnitID) The missing fields not come from
What can we do?
Which option we should choose? |
This would be my choice since pushing more BE changes would only extend the duration of fixing this specific issue. Once @Gonals comes back with the details of the API pull request changes and you have the required data to move forward with the PR and implement the fix, we should be all good. |
@ikevin127 The PR is Ready #51519 @Gonals The previous found issue #48630 (comment) can be resolved by calling |
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. |
We discussed the upcoming regression in the PR (#51519 (comment)) and we decided to ship it like this because the fix for it was out of scope for the issue. Therefore even though this is technically a regression of our PR, we decided not to count it as regression when it comes to compensation. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.56-9 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-11-11. 🎊 For reference, here are some details about the assignees on this issue:
|
@ikevin127 @isabelastisser The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test ProposalTest:
Do we agree 👍 or 👎. |
@Gonals for consistency and to avoid potential dev only bug, I think it's better if GET_ROUTE_FOR_BACKUP endpoint also deployed to BE dev server |
@ikevin127 @wildan-m, the payments are processed in Upwork and the regression test issue is created. Is there an ongoing discussion here or can I close this issue now? Thanks! |
I think we can close it, the follow-up issue will be handled separately. #51785 |
All set! |
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.29-0
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 protected]
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause-Internal team
Action Performed:
Expected Result:
The receipt in the transaction thread will remain generated.
Actual Result:
The receipt in the transaction thread turns to placeholder thumbnail.
Sometimes, the map loads, but the map is not clickable (it is still in the loading state and not generating the actual receipt).
This issue also happens when opening distance editor right after the distance expense is submitted before the receipt is generated.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6592667_1725441403897.20240904_171033.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @isabelastisserThe text was updated successfully, but these errors were encountered: