-
Notifications
You must be signed in to change notification settings - Fork 260
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
task(crypto): Support receiving stable identifier for MSC4147 #4420
task(crypto): Support receiving stable identifier for MSC4147 #4420
Conversation
5bc353e
to
723cb6a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4420 +/- ##
=======================================
Coverage 85.42% 85.42%
=======================================
Files 283 283
Lines 31556 31556
=======================================
Hits 26958 26958
Misses 4598 4598 ☔ View full report in Codecov by Sentry. |
@@ -177,7 +177,7 @@ where | |||
pub recipient_keys: OlmV1Keys, | |||
/// The device keys if supplied as per MSC4147 | |||
#[serde(rename = "org.matrix.msc4147.device_keys")] |
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.
I tought that the trick was to use serde(alias =
?
how is it working here?
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.
Yep, unless I'm missing something, this is only renaming the variable when it's used on the Rust side, so this is an internal renaming, so this may not be what you intended to do?
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.
Err, it's renaming the field during serialization/deserialization. The serialized JSON will contain org.matrix.msc4147.device_keys
during serialization and we will expect org.matrix.msc4147.device_keys
during deserialization. While the code have the more pleasant name.
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.
Well spotted! A fix, and, critically, a test that proves it works, are in c093e7c
@@ -177,7 +177,7 @@ where | |||
pub recipient_keys: OlmV1Keys, | |||
/// The device keys if supplied as per MSC4147 | |||
#[serde(rename = "org.matrix.msc4147.device_keys")] |
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.
Yep, unless I'm missing something, this is only renaming the variable when it's used on the Rust side, so this is an internal renaming, so this may not be what you intended to do?
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 do use mostly "deserialize" in this simplified en-us code base, but that might not be review comment worthy. LGTM :)
Thanks, fixed in 17f074b |
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.
Thx, LGTM.
17f074b
to
e557586
Compare
Part of element-hq/element-meta#2665
On the receiving side, allow
sender_device_keys
as well asorg.matrix.msc4147.device_keys
for the sender's device keys in to-device event. Once this has time to bed in, we will change the sending side to use this stable identifier since the MSC has been merged.