-
Notifications
You must be signed in to change notification settings - Fork 371
refactor(base): Use PossiblyRedactedStateEventContent bound in MinimalStateEvent
#6088
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6088 +/- ##
==========================================
+ Coverage 89.83% 89.90% +0.06%
==========================================
Files 360 360
Lines 99873 99789 -84
Branches 99873 99789 -84
==========================================
- Hits 89723 89712 -11
+ Misses 6641 6575 -66
+ Partials 3509 3502 -7 ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
|
f955c94 to
2989dfe
Compare
| #[serde( | ||
| bound(serialize = "C: Serialize + Clone"), | ||
| from = "MinimalStateEventSerdeHelper<C>", | ||
| into = "MinimalStateEventSerdeHelper<C>" |
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.
Note: I would have preferred to be able to serialize this directly without a tag, but for some reason applying #[serde(untagged)] on a variant of the deserialization helper makes the deserialization of the join rules content fail.
…lStateEvent We usually don't care if the event was redacted or not, we usually want to no whether a field is set or not, so we don't need `Original` and `Redacted` variants. This simplifies several parts of the code since we don't have to handle the intermediate enum to access the content now. Due to new APIs in Ruma we can also just convert original and redacted event contents to possibly redacted event contents. Signed-off-by: Kévin Commaille <[email protected]>
2989dfe to
e5005b7
Compare
We usually don't care if the event was redacted or not, we usually want to know whether a field is set or not, so we don't need
OriginalandRedactedvariants.This simplifies several parts of the code since we don't have to handle the intermediate enum to access the content now. Due to new APIs in Ruma we can also just convert original and redacted event contents to possibly redacted event contents.
This should allow further code removal in a follow-up PR, by allowing to use the same code to handle
Sync*andStripped*events inRoomInfo.The backwards-compatible deserialization of
MinimalStateEventwas verified in a client with Fractal.