Fix local only message deletion #6157
Conversation
Co-Authored-By: Claude <[email protected]> Co-authored-by: Cursor <[email protected]>
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
WalkthroughA new utility function Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
SDK Size Comparison 📏
|
|
|
🚀 Available in v6.32.3 |



Goal
When deleting messages that were never synced to the server (e.g.
SYNC_NEEDED,FAILED_PERMANENTLY, error/ephemeral types, moderation bounce), we should delete them locally only and skip the Delete API call.Additionally, this fixes a case where we have a local-only error message (rejected by pre-send webhook) cannot be deleted -
type = error, andDeletefails because the message is not present on BEImplementation
Message.shouldDeleteRemote()to returnFailure(skip API) forSYNC_NEEDEDandFAILED_PERMANENTLYin addition toIN_PROGRESS, error, ephemeral, and moderation bounceDeleteMessageListenerStateandDeleteMessageListenerDatabaseuseshouldDeleteRemoteinonMessageDeletePreconditionto delete locally when the message is local-onlyonMessageDeleteRequest(removed redundantisModerationErrorcheck) since precondition already gates the request🎨 UI Changes
before-delete.mp4
after-delete.mp4
Testing
This a simulated scenario, not really testable in regular case. The idea is to attempt to delete a message with
type=errorPatch
type=errormessage as soon as it appears)Summary by CodeRabbit
Release Notes
Bug Fixes
Tests