This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Properly verify and error on power-level mismatch in /batch_send
endpoint
#13229
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #13216
Signed-off-by: Sumner Evans [email protected]
Outstanding Problem
In the
test_batch_send_with_permission_msc2716_room_version
test, I set thehistorical
power level to 0 before calling the/batch_send
endpoint: https://github.com/matrix-org/synapse/pull/13229/files#diff-7ec980d681db7426675aa46dfb312defa64ba0a6fa763f97eac107e9567c7e7fR438-R451However, when the batch-send endpoint gets to the permission checks, it gets the power levels and
historical
is at 100, making the test fail.Things I've done to debug include:
self.helper.get_state
again after thesend_state
to ensure that the power level is correct. This returned the expected value forhistorical
of 0.get_named_levels
, when the power levels event is retrieved, it hashistorical
set to 100, which makes me think that maybe theauth_events
being passed in are stale?Clues I have:
self.event_creation_handler.create_event
, it getsinitial_state_event_ids
passed in. This doesn't include the power levels event.Asked for spec clarification here: https://github.com/matrix-org/matrix-spec-proposals/pull/2716/files#r924472086
Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.(run the linters)