Repository navigation
Populate ChannelData.deletedAt when a channel is deleted - #6693
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
SDK Size Comparison 📏
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughChannel deletion events now update active channel state before disposal. Both deletion event types preserve messages and record ChangesChannel deletion handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant EventHandlerSequential
participant ChannelEventHandler
participant StateRegistry
participant LogicRegistry
EventHandlerSequential->>ChannelEventHandler: forward deletion event
ChannelEventHandler->>ChannelEventHandler: set deletedAt and preserve messages
EventHandlerSequential->>StateRegistry: handle batch event
EventHandlerSequential->>LogicRegistry: remove channel logic
Merge Risk: ⚪ Minimal · up to Channel deletion now records deletedAt before active logic is discarded and preserves messages for later truncation. Coverage exercises both event variants and disposal ordering, with no actionable current-head risk evident. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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. A rabbit taps the event stream bright Comment |
|
|
🚀 Available in v6.44.0 |




Goal
ChannelState.channelData.deletedAtwas never populated, so an open chat screen had no way to tell that itschannel had been deleted. Listening for
ChannelDeletedEventwas the only working signal.Closes AND-1522
Implementation
EventHandlerSequentialevicted thechannel from both registries first, so
channel.deletednever reachedChannelEventHandlerand the branchsetting the deletion date had been dead since the eviction was introduced. The channel is still discarded
right after, and
channelDatakeeps the value for consumers already holding the state.notification.channel_deletedinChannelEventHandler, which had no branch for it at all.iOS, where message visibility is gated on the channel's
truncatedAtand never on its deletion date. Noreleased version cleared them here, since the branch was unreachable.
Testing
EventHandlerSequentialChannelDeletedTestcovers both event types over the realStateRegistryandLogicRegistry, asserting the deletion date reaches an active channel's state and that the channel isstill discarded afterwards. Both rows fail without the reorder, which a registry mock would not catch.
deletedAtfrom null to the deletion date while the message count stayed put.
Summary by CodeRabbit