Fix bugs that could wedge rooms (#2154)

* Don't flake so badly for rejected events

* Moar

* Fix panic

* Don't count rejected events as missing

* Don't treat rejected events without state as missing

* Revert "Don't count rejected events as missing"

This reverts commit 4b6139b62eb91ba059b47415b0275964b37d9b43.

* Missing events should be KindOld

* If we have state, use it, regardless of memberships which could be stale now

* Fetch missing state for KindOld too

* Tweak the condition again

* Clean up a bit

* Use room updater to get latest events in a race-free way

* Return the correct error

* Improve errors
This commit is contained in:
Neil Alexander 2022-02-07 19:10:01 +00:00 committed by GitHub
parent 908d881a6e
commit a572f4db03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 31 deletions

View file

@ -209,6 +209,12 @@ type MissingEventError string
func (e MissingEventError) Error() string { return string(e) }
// A RejectedError is returned when an event is stored as rejected. The error
// contains the reason why.
type RejectedError string
func (e RejectedError) Error() string { return string(e) }
// RoomInfo contains metadata about a room
type RoomInfo struct {
RoomNID RoomNID