-
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
Сhat - Message deleted in offline are not striked out #52344
Comments
Triggered auto assignment to @kadiealexander ( |
Edited by proposal-police: This proposal was edited at 2024-11-12 00:12:44 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.What is the root cause of that problem?When we send message in offline mode then we delete the comment, it will invoke this function App/src/libs/actions/Report.ts Line 1431 in b2d6a0e
and apply the onyx data and set the pending action to DELETE App/src/libs/actions/Report.ts Lines 1450 to 1452 in b2d6a0e
App/src/libs/actions/Report.ts Lines 1553 to 1559 in b2d6a0e
After this PR #51422 we will resolve if there's a conflicts when deleting the comment using resolveCommentDeletionConflicts functionApp/src/libs/actions/Report.ts Line 1558 in b2d6a0e
Inside
App/src/libs/actions/RequestConflictUtils.ts Lines 71 to 74 in b2d6a0e
App/src/libs/actions/RequestConflictUtils.ts Lines 88 to 100 in b2d6a0e
Since we send the message in offline mode so the AddComment request will go to PersistedRequests first then it will get proceed when it's online, so it will delete the comment permanently What changes do you think we should make in order to solve the problem?Solution 1: We can remove this code, because we do not want the delete comment get deleted permanently in offline mode App/src/libs/actions/RequestConflictUtils.ts Lines 88 to 100 in b2d6a0e
Solution 2: We can rollback the changes if it's not offline mode I think we should not delete permanently in offline mode even there's a new comment, we should set the pending action to DELETE What alternative solutions did you explore? (Optional)We can rollback the changes if the index AddComment request is greater than the DeleteComment request meaning the user delete a comment then the user new comment we will rollback the changes function resolveCommentDeletionConflicts(persistedRequests: OnyxRequest[], reportActionID: string, originalReportID: string, currentRequest: string): ConflictActionData {
...
const sendNewMessage = [...addNewMessage];
if (addNewMessage.has(request.command) && sendNewMessage.indexOf(request.command) > sendNewMessage.indexOf(currentRequest) && !request.isRollbacked) {
addCommentFound = true;
commentCouldBeThread[reportActionID] = commentIndicesToDelete.length;
} |
This can be expected BTW. If the user created and deleted a message offline there is no need to show it or even send the create and delete API requests to the BE. |
This does seem like expected behaviour. Closing as not a bug, please reopen if you disagree. |
This issue is still valid and reproduces even if we create a message online and then delete it offline. Message not strike out Desktop-deleted-msg-offline.mp4 |
I created a new issue as it is a deploy blocker for build v9.0.64-0, issue happens only on MacOS #52753 |
Android <> iOS bug swap with @jliexpensify |
@IuliiaHerets - can you confirm this is a Chrome/Safari issue only? Not an Android one? |
It also seems like we could close this in favour of #52753? |
@jliexpensify Yes, issue has happened only on MacOS (Safari, Chrome and Desktop). |
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.60
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Message deleted in offline must be striked out
Actual Result:
Message deleted in offline are not striked out
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6661815_1731357681420.Screenrecorder-2024-11-12-02-02-31-217.mp4
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: