rtc: Handle non-MXID call member event state keys#3836
rtc: Handle non-MXID call member event state keys#3836bnjbvr merged 11 commits intomatrix-org:mainfrom
Conversation
Update Ruma dependency to expect call membership state events with state keys that are arbitrary strings, not just pure MXIDs. When a call membership state key does not exactly match the format of an MXID, treat it as a valid state key if it starts with an MXID followed by an underscore, with that MXID designating the owner of the event. (The state key may also be optionally prefixed with an underscore, which is permitted as a way to bypass pre-MSC3757 authorization rules against sending state events with state keys that do not exactly match the sender's MXID.)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3836 +/- ##
==========================================
+ Coverage 84.12% 84.13% +0.01%
==========================================
Files 263 263
Lines 27592 27605 +13
==========================================
+ Hits 23211 23225 +14
+ Misses 4381 4380 -1 ☔ View full report in Codecov by Sentry. |
bnjbvr
left a comment
There was a problem hiding this comment.
Thanks, looks sane but it'd be nice to have some basic unit tests (which would also show what behavior is expected and what isn't).
|
(Sorry @stefanceriu, I hadn't seen you removed my review request, and the PR is simple enough that I could take a look — feel free to re-take over if you prefer!) |
stefanceriu
left a comment
There was a problem hiding this comment.
I hadn't seen you removed my review request
Oh no worries, I only removed you because I can test it end to end, but it doesn't really matter.
It seems to work just fine on both call.element.io and call.element.dev so from my point of view you can merge it after adressing benji's concerns. Nicely done! 👍
bnjbvr
left a comment
There was a problem hiding this comment.
Getting closer, thanks for making a separate function and writing tests!
Co-authored-by: Benjamin Bouvier <public@benj.me> Signed-off-by: Andrew Ferrazzutti <andrewf@element.io>
bnjbvr
left a comment
There was a problem hiding this comment.
Looks good to me, modulo test nits, thanks! Please push another commit with the test changes, and then no need to ask for another review, I'll merge it 👍
|
I've addressed the nits for you actually, so we can merge :) |
Update Ruma dependency to expect call membership state events with state keys that are arbitrary strings, not just pure MXIDs.
When a call membership state key does not exactly match the format of an MXID, treat it as a valid state key if it starts with an MXID followed by an underscore, with that MXID designating the owner of the event.
(The state key may also be optionally prefixed with an underscore, which is permitted as a way to bypass pre-MSC3757 authorization rules against sending state events with state keys that do not exactly match the sender's MXID.)
Signed-off-by: Andrew Ferrazzutti andrewf@element.io