Migrate the message reaction lists to the generated ReactionResponse model - #6682
Draft
gpunto wants to merge 1 commit into
Draft
Migrate the message reaction lists to the generated ReactionResponse model#6682gpunto wants to merge 1 commit into
gpunto wants to merge 1 commit into
Conversation
Contributor
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
Contributor
SDK Size Comparison 📏
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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.