Repository navigation
Migrate the new message event to the generated event model - #6790
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (13)
💤 Files with no reviewable changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review. WalkthroughThe ChangesGenerated message.new event mapping
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Refactor Sequence Diagram(s)sequenceDiagram
participant EventAdapter
participant MessageNewEvent
participant EventMapping
participant NewMessageEvent
EventAdapter->>MessageNewEvent: parse message.new JSON
MessageNewEvent->>EventMapping: provide generated event fields
EventMapping->>NewMessageEvent: map message and channel information
Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change moves message.new parsing to the generated event model, and no merge-blocking issue was found. Replayed events that omit some fields are handled with safe defaults. 🚥 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 checks the message stream, Comment |
andremion
left a comment
There was a problem hiding this comment.
Looks good. One small nit inline.
10c4062 to
f7e17d2
Compare
|



Goal
Parse the
message.newevent with the generated event model.Part of AND-1291
Implementation
MessageNewEventand deleteNewMessageEventDtoandDownstreamChannelCustomDto(ChannelDtos.ktis renamedDownstreamChannelDto.kt, its only class).channel_custom.message_idandwatcher_countare nullable in the vendored model: backends before v239.47.0 replaymessage.newon/syncwithout them, and the spec marks them required. A missing watcher count maps to 0 and missing unread counts stay 0, as before; the mapper never readsmessage_id. The model comment says when to drop the patch.Testing
NewMessageEventParsingTestnow compares the fast parser with the generated path and they produce identical events. Its fixtures carry the fields the backend always sends, through aWireShapetest helper shared withMessageResponseParityTest. Where the two paths deliberately differ, the generated path takes the channel type and id from the cid and treats an event without a type as unknown. The mapping tests cover every field and the replayed shape.On a device: sent a message with custom data in a channel with a name and an image, a thread reply, and channel update and truncate system messages (the truncate event carries the channel). Every domain field was set, custom data round-tripped, and
/syncparsed the replayed event.🤖 Generated with Claude Code
Summary by CodeRabbit