Rotate the current room key when we see a member leave (#5231)
* feat: Rotate room key when a member leaves the room
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
* test: Assert room key rotated to prevent MSC4268 leaking keys
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
* docs: Outline key rotation scenario above discard logic
* feat: Use `RoomStateEvents.Events` over membership event
* docs: Correct spelling in scenario explanation
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* docs: Pull scenario explanation up to `onRoomStateEvent`
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
* tests: Assert room key is rotated under leave va gappy sync
* tests: Build sync response incrementally for gappy/ungappy sync
---------
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>