-
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
[HOLD for payment 2023-09-20] [$1000] Temporary thread message disappearance when deleting a thread message #23139
Comments
Triggered auto assignment to @MitchExpensify ( |
Bug0 Triage Checklist (Main S/O)
|
I see some discussion related to this here https://expensify.slack.com/archives/C049HHMV9SM/p1685965494942699?thread_ts=1684354260.051229&cid=C049HHMV9SM |
Also related to the first thread message and deletion but not quite this issue #19363 |
Not a dupe from what I can tell |
Job added to Upwork: https://www.upwork.com/jobs/~01ed092abd8ef6cd10 |
Current assignee @MitchExpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.When we delete a Thread parent, It disappears for a moment, and then the [Deleted message] message appears. What is the root cause of that problem?The root cause is in the following data {
"onyxMethod": "merge",
"key": "reportActions_3529565171134454",
"value": {
"6902849697016981155": {
"childVisibleActionCount": 0,
"childCommenterCount": 0,
"childLastVisibleActionCreated": "",
"childOldestFourAccountIDs": ""
}
}
}
What changes do you think we should make in order to solve the problem?Removing the following act of pushing this object with empty values solves the issue. (but this may affect some other part of code, so adding the alternate solution is better and more efficient.) if (parentReportAction && parentReportAction.reportActionID) {
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID}`,
value: {
[parentReportAction.reportActionID]: ReportUtils.updateOptimisticParentReportAction(
parentReportAction,
optimisticReport.lastVisibleActionCreated,
CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
),
},
});
} What alternative solutions did you explore? (Optional)In What's the purpose of this? Removing this part of code also solves the problem. if (childVisibleActionCount > 0) {
childVisibleActionCount -= 1;
} or we can add a condition here that if - if (childVisibleActionCount > 0)
+ if (childVisibleActionCount > 0 && childVisibleActionCount !== 1) |
📣 @aditya-ragi! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
just added alternate solution to the proposal now. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Temporary thread message disappearance when deleting a thread message What is the root cause of that problem?Should hide on delete is true by default. It is only false if a message has thread child. App/src/pages/home/report/ReportActionItem.js Line 494 in 5419d9b
Previously hasCommentThread was working fine until lodashGet(reportAction, 'childVisibleActionCount', 0) > 0 was added. As thread first chat does not has childVisibleActionCount so this function is returning false. What changes do you think we should make in order to solve the problem?We should also add another check here to see if it's thread first message we can do something like this
This issue will fix this. We can also add this change in other place where we are using hasCommentThread Additional changes Line 1390 in 48edd31
here we are decrementing the childVisibleActionCount. Let's say we have 2 comments in thread
Here childVisibleActionCount will be 1 but if we delete the parent message the visibility count will be "0". This is not logically correct because we still have the child text. We can pass reportID here Line 1373 in 48edd31
Line 1390 in 48edd31
only then we will decrement the childVisibleActionCount What alternative solutions did you explore? (Optional)Or we can fix it directly in hasCommentThread like this
|
ProposalPlease re-state the problem that we are trying to solve in this issue.The thread message should remain visible without any disappearance upon deletion What is the root cause of that problem?I've found the old commit code where the thread message delete functionality working fine. #22690 If you revert the code with this:
Then it's working fine. I hope this will solve the problem. Thanks |
📣 @jigartankhupp! 📣
|
ProposalPlease re-state the problem that we are trying to solve in this issue.In a thread of a message, when we try to delete the message when thread has no other replies/messages, it disappears before showing What is the root cause of that problem?The message disappears momentarily on deleting a thread message in its thread room while it waits for the response from the This is not the case when we are deleting a thread message(with replies) in the main chat room. When we delete a thread message with children(or replies) in main chatroom, While waiting for the API response, the message gets hidden by the What changes do you think we should make in order to solve the problem?To tackle this we can the following condition to prop shouldHideOnDelete={!(ReportActionsUtils.hasCommentThread(props.action) || props.action.reportActionID === props.report.parentReportActionID)} When a report action/message is being rendered in its own chat room/thread room, the action passed to This change will prevent the message that is deleted from disappearing momentarily but there would still be a problem where the initial message will continue to be displayed until the Api request is complete after which To avoid this, we can add a similar condition here. I would propose we rename the shouldDisplayDeletedWhenPending={ReportActionsUtils.hasCommentThread(props.action) || props.action.reportActionID === props.report.parentReportActionID} We replace this prop in with Please node that we would also need to pass |
Contributor details |
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
ProposalPlease re-state the problem that we are trying to solve in this issue.First thread message disappears for a few seconds before reappearing as [Deleted message]. Ideally it should just change and not disappear and reappear. What is the root cause of that problem?Adding What changes do you think we should make in order to solve the problem?Removing App/src/libs/actions/Report.js Lines 950 to 961 in be2c81f
This solution will also not affect any other delete comment behaviour as this action only removes the comment from the report and anyways that will happen on the ‘DeleteComment’ api call as the whole report gets updated.
Remove following code App/src/libs/actions/Report.js Lines 951 to 955 in be2c81f
After removing
|
📣 @fedirjh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @Nodebrute 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
📣 @ayazhussain79 We're missing your Upwork ID to automatically send you an offer for the Reporter role. |
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.68-17 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-09-20. 🎊 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:
As a reminder, here are the bonuses/penalties that should be applied for any External 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 summary: $1000 - @fedirjh requires payment offer (Reviewer) |
Friendly bump on the BZ steps @fedirjh |
Paid: Pending: |
@MitchExpensify Offer accepted, Thank you |
Paid! Thanks @ayazhussain79 Waiting on BZ steps before closing this out cc @fedirjh |
BugZero Checklist:
Regression Test Proposal
|
Awesome added a request to add this! https://github.com/Expensify/Expensify/issues/319505 |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
The thread message should remain visible without any disappearance upon deletion
Actual Result:
When deleting a thread message, it momentarily disappears for a second before reappearing
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.42-21
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
screen-recording-2023-07-17-at-71701-pm_7JOAkxG1.mp4
Recording.1290.mp4
Expensify/Expensify Issue URL:
Issue reported by: @ayazhussain79
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689603772547949
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: