fix: allow redact-power users to end polls (MSC3381)#2413
Conversation
PR SummaryLow Risk Overview Documentation on Reviewed by Cursor Bugbot for commit 6c5ce3e. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2413 +/- ##
==========================================
+ Coverage 59.62% 59.66% +0.03%
==========================================
Files 161 161
Lines 20329 20329
==========================================
+ Hits 12121 12129 +8
+ Misses 8208 8200 -8
Continue to review full report in Codecov by Harness.
|
krille-chan
left a comment
There was a problem hiding this comment.
From the MSC:
If a m.poll.end event is received from someone other than the poll creator or user with permission to redact other's messages in the room, the event must be ignored by clients due to being invalid.
So you are right :) I also checked that we are already correctly parsing it manually, just this check was missing. Thank you very much
|
@Quantumheart you need to sign your commit and make sure you accepted the CLA (the cla bot may be prompted once you signed your commit) |
e8ffb57 to
8718497
Compare
8718497 to
ba79bc2
Compare
The endPoll() send helper only permitted the poll creator to end a poll, whereas the receive-side validator (_getEndPollEvent) honours m.poll.end events from the creator or any user with redact power, per MSC3381. Align the send guard with the spec and the receive-side check by also allowing callers with room.canRedact. Signed-off-by: quantumheart <canteen0072@proton.me>
ba79bc2 to
52d19d8
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 52d19d8. Configure here.
The denial-case expectLater was unawaited, so its async matcher could run after the subsequent redact-power injection and race the assertion. Signed-off-by: quantumheart <canteen0072@proton.me>
|
Resolved in 6c5ce3e — the denial-case |
|
@krille-chan are you able to approve the workflow? Thanks in advance. |

Summary
I am working on a Matrix client called Kohera. I am currently, working through the polling spec 3381 and found that the power level redaction is not respected for moderators.
Changes