Fix delete message not working when offline (SYNC_NEEDED)#6184
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
WalkthroughThe changes remove Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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 📏
|
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
🚀 Available in v6.32.4 |



Goal
Messages with
SYNC_NEEDEDsync status (i.e., messages that were sent while offline and are pending sync) were incorrectly treated as local-only when a delete was requested. This caused the delete API to be skipped, leaving the message undeleted on the server once connectivity was restored.Resolves: https://linear.app/stream/issue/AND-1093/
Implementation
Removed
SyncStatus.SYNC_NEEDEDfrom the local-only guard condition inMessage.shouldDeleteRemote(). Messages inSYNC_NEEDEDstate are pending a sync attempt, so when the user deletes them the remote delete API should be called once connectivity is available.Updated the corresponding tests to reflect the corrected behavior:
SYNC_NEEDED→Result.Success(remote delete allowed)UI Changes
No UI changes.
Testing
Summary by CodeRabbit
Bug Fixes
Tests