Migrate the message reaction lists to the generated ReactionResponse model - #6682
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
b51475b to
9559175
Compare
|
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 (8)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughThe message DTO now uses generated ChangesReactionResponse migration
Estimated code review effort: 2 (Simple) | ~15 minutes Merge Risk: ⚪ Minimal · up to Message reaction lists now use the generated response model while preserving reaction filtering and domain mapping. The supplied coverage and fixture updates align with the new wire shape, with no identified merge-blocking risk. Sequence Diagram(s)Reaction mapping flow sequenceDiagram
participant MessageDto
participant DomainMapping
participant ReactionResponse
MessageDto->>DomainMapping: map latest_reactions and own_reactions
DomainMapping->>ReactionResponse: filter by messageId
DomainMapping-->>MessageDto: return domain reactions
Suggested reviewers: 🚥 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 hops through fields of green Comment |
andremion
left a comment
There was a problem hiding this comment.
Looks good. One thing that has no line to sit on: the Notes say a null latest_reactions is coerced to an empty list, but the property is non-null with no default, so a JSON null throws unexpectedNull. Your probe working suggests it comes back as [] instead. Could you fix the note? Nits inline, all optional.
|
On the note: you are right, and my wording had it backwards. The property is non-null with no default, and Worth knowing while we are here: the only outbound builder is |
|
|
🚀 Available in v7.11.0 |



Goal
Parse a message's
latest_reactionsandown_reactionswith the generatedReactionResponse.Part of AND-1291
Implementation
ReactionResponseand replace the DTO list mapper withtoReactions(messageId). The name differs because JVM erasure would clash with theDownstreamReactionDtooverload.ReactionResponse.toDomain()already exists, so no per-reaction mapping is added, and the@StreamHandsOffrecording why the list is filtered by message id carries over.created_at,updated_atandlanguageon its user.createUserJsonStringis an own-user shape carrying unread counts, devices, mutes andinvisible, none of which the wire sends for a reaction's user, and through the generated model they either vanish or land incustom.DownstreamReactionDtostays for the reaction events, which still parse it.Notes
The generated model requires both timestamps and a non-null
userwhere the DTO allowed them absent.payload.ReactionResponsedeclaresUseras a value type with a plain tag and both timestamps withoutomitempty, andMessageResponse.LatestReactions/OwnReactionsare that same struct, so an embedded reaction always carries them.Testing
getMessageandqueryChannels. Every reaction in both lists mapped fully, each nested user carried the three required fields, and the emoji and custom values round-tripped whileemoji_codestayed out ofextraData.ReactionResponse.toDomain: all 9 mapped fields are caught by a test.latest_reactionscomes back empty from a channel query because only some endpoints addEnrichLatestReactionsserver-side, whileown_reactionsis populated. It arrives as an empty array rather than null: the property is non-null with no default, andNullCollectionsAsEmptyFactoryonly applies to the generated package, so neither a null nor an absent key would be coerced. Unchanged by this PR, where the field was equally non-null.Summary by CodeRabbit
Bug Fixes
Tests