Migrate the message reaction lists to the generated ReactionResponse model - #6682
Migrate the message reaction lists to the generated ReactionResponse model#6682gpunto wants to merge 1 commit into
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 |



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. That is unchanged by this PR: the field arrives as JSON null either way and is coerced to an empty list.Summary by CodeRabbit
Bug Fixes
Tests