aboutsummaryrefslogtreecommitdiff
path: root/roomserver/internal/query/query.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-02-07 19:10:01 +0000
committerGitHub <noreply@github.com>2022-02-07 19:10:01 +0000
commita572f4db034e13aa38e122d1c4233b15e2356494 (patch)
tree21438de7478d446e10f6ceb44b166515232a5324 /roomserver/internal/query/query.go
parent908d881a6e2049ab150f58c0697773656fc27a98 (diff)
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
Diffstat (limited to 'roomserver/internal/query/query.go')
-rw-r--r--roomserver/internal/query/query.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/roomserver/internal/query/query.go b/roomserver/internal/query/query.go
index 6b4cb581..84553303 100644
--- a/roomserver/internal/query/query.go
+++ b/roomserver/internal/query/query.go
@@ -149,7 +149,8 @@ func (r *Queryer) QueryMissingAuthPrevEvents(
}
for _, prevEventID := range request.PrevEventIDs {
- if state, err := r.DB.StateAtEventIDs(ctx, []string{prevEventID}); err != nil || len(state) == 0 {
+ state, err := r.DB.StateAtEventIDs(ctx, []string{prevEventID})
+ if err != nil || len(state) == 0 {
response.MissingPrevEventIDs = append(response.MissingPrevEventIDs, prevEventID)
}
}