-
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 2023-11-21] [$500] LHN - Money Request removal offline doesn't update LHN correctly #28941
Comments
Triggered auto assignment to @dylanexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
Job added to Upwork: https://www.upwork.com/jobs/~01e4ad059b092f74b3 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @burczu ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Once IOU report is deleted, the parent report's last message is not updated in LHN What is the root cause of that problem?When deleting a Money Request, if it's the last request in the IOU report, we optimistically update the parent report: Lines 1567 to 1580 in 1663440
We explicitly tell the App/src/libs/ReportActionsUtils.js Lines 381 to 387 in f6efb26
What changes do you think we should make in order to solve the problem?If the if (actionsToMerge && Object.keys(actionsToMerge).length !== 0) {
Object.keys(actionsToMerge).forEach(
- (actionToMergeID) => (updatedActionsToMerge[actionToMergeID] = {...allReportActions[reportID][actionToMergeID], ...actionsToMerge[actionToMergeID]}),
+ (actionToMergeID) => (updatedActionsToMerge[actionToMergeID] = lodashIsNull(actionsToMerge[actionToMergeID]) ? null : {...allReportActions[reportID][actionToMergeID], ...actionsToMerge[actionToMergeID]}),
);
} And also, for better code reuse, in // STEP 5: Build Onyx data
+ const optimisticChatReportActions = {[reportPreviewAction.reportActionID]: updatedReportPreviewAction};
const optimisticData = [
......
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport.reportID}`,
- value: {
- [reportPreviewAction.reportActionID]: updatedReportPreviewAction,
- },
+ value: optimisticChatReportActions,
},
...(shouldDeleteIOUReport
? [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${chatReport.reportID}`,
value: {
hasOutstandingIOU: false,
iouReportID: null,
- lastMessageText: ReportActionsUtils.getLastVisibleMessage(iouReport.chatReportID, {[reportPreviewAction.reportActionID]: null}).lastMessageText,
- lastVisibleActionCreated: ReportActionsUtils.getLastVisibleAction(iouReport.chatReportID, {[reportPreviewAction.reportActionID]: null}).created,
+ lastMessageText: ReportActionsUtils.getLastVisibleMessage(iouReport.chatReportID, optimisticChatReportActions).lastMessageText,
+ lastVisibleActionCreated: ReportActionsUtils.getLastVisibleAction(iouReport.chatReportID, optimisticChatReportActions).created,
},
},
]
: []),
]; Result:iou-delete-offline.movWhat alternative solutions did you explore? (Optional)We can alternatively leave the |
ProposalPlease re-state the problem that we are trying to solve in this issue.LHN - Money Request removal offline doesn't update LHN correctly What is the root cause of that problem?After deleting the request money action, we update the lastMessageText of parent report Line 1575 in e078b4a
As we're passing In App/src/libs/ReportActionsUtils.js Lines 387 to 397 in e078b4a
but actionsToMerge[actionToMergeID] is null -> it will be ignored What changes do you think we should make in order to solve the problem?we need to merge 2 objects to achieve the final objects, so we should do the same as onyx implement
ResultScreen.Recording.2023-10-06.at.15.25.47.mov |
@burczu, @dylanexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@burczu can we review these soon? 🙇♂️ |
bump @burczu |
@dylanexpensify Ahh, sorry - I've missed this one... I'll take a look today! |
@paultsimura Just to note, posting code diffs in proposals is not allowed. |
@burczu it was discussed multiple times recently and the agreement was that the proposal must not consist only of code diffs, but the code diffs are welcomed as they help describing the changes:
https://expensify.slack.com/archives/C01GTK53T8Q/p1694106505333079 |
@paultsimura Alright! Thanks for pointing this out ;) |
@paultsimura and @tienifr I've just tested your solutions and they both works until we go back online. Please see what happens after that: Screen.Recording.2023-10-11.at.10.47.36.movI think this should be also handled in this issue. |
@burczu After dig deeper on Onyx implementation, I found out that:
Here is the result if I perform the onyx actions sequentially Screen.Recording.2023-10-11.at.18.45.36.mp4I think it's out of this scope (The expectation is |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@burczu mind replying to the above? 🙇♂️ |
@dylanexpensify I'm sorry, I was busy reviewing PR's - I'll get back to checking proposals soon. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.98-5 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 2023-11-21. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on 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:
|
Payment time! @burczu to complete checklist |
@dylanexpensify Sorry for the delay - I'll get back to BZ Checklists soon, after I finish reviewing my PR's and proposals. |
Will you be able to do that before EOW @burczu ? |
Yes, I’ll be completing BZ checklists tomorrow.
|
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:
Didn't find any.
Regression test proposal in a separate comment.
|
Regression test proposal
|
I don't know, feels a bit niche. |
@flodnv, @burczu, @dylanexpensify, @tienifr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@flodnv I wonder if we have some regression tests for deleting money requests - maybe we just need to add some offline steps there? But I'm also ok with not adding regression test at all for this if you feel it's an overkill. |
Good call, let's ask that to Applause @dylanexpensify and close this issue |
Hey @dylanexpensify, could you please check the payment on this issue? |
looking now! |
paid! |
@dylanexpensify sorry, I also wasn't paid as Contributor yet, could you process the payment for me as well, thanks! |
@dylanexpensify Gentle bump on this, thanks! |
omg sorry! Yes on it now! |
@tienifr done! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
In the LHN, the chat with user B should show the last visible message
Actual Result:
In the LHN, the chat with user B shows " owes " until going back online
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.78.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 or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
ios.1.mov
android.1.mov
desktop.2.mov
safari.MP4
chrome.MP4
272100142-18604d4d-3bc9-4507-893a-d5d2204648e3.mp4
Recording.4879.mp4
Expensify/Expensify Issue URL:
Issue reported by: @paultsimura
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696501720522399
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: