-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
json deserialization for legacy reactions #1488
base: main
Are you sure you want to change the base?
json deserialization for legacy reactions #1488
Conversation
7b61e5b
to
a7ab65f
Compare
a7ab65f
to
1744eca
Compare
@@ -47,6 +48,41 @@ impl ContentCodec<ReactionV2> for ReactionCodec { | |||
} | |||
} | |||
|
|||
#[derive(Debug, Serialize, Deserialize)] | |||
pub struct LegacyReaction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't shoe-horn the legacy reaction into the new reaction type? I thought the data was about the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original type had arbitrary String for reaction action and reaction schema (js sdk used union type to restrict it), I updated to enum in the new proto type to be more precise so we wouldnt need to do this type of conversion across all the SDKs: https://github.com/xmtp/xmtp-android/blob/51c7b170d53f73d32d3a1d33b0d170d156183e43/library/src/main/java/org/xmtp/android/library/codecs/ReactionCodec.kt#L40-L55
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh. Too bad.
Agree the new format is nicer.
👋 Sorry for the drive by comment here just getting caught up on my notifications. |
Part of #1403