aboutsummaryrefslogtreecommitdiff
path: root/roomserver/storage
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-02-21 16:22:29 +0000
committerGitHub <noreply@github.com>2022-02-21 16:22:29 +0000
commitaa6bbf484a7963a754d47ba04869c06b72d4ee49 (patch)
tree1e558f5892f6c244815f725862d21ae39a4ddf2b /roomserver/storage
parentcf525d1f619cc65df244c20ec0f220ace22ae2bd (diff)
Return `ErrRoomNoExists` if insufficient state is available for a `buildEvent` to succeed when joining a room (#2210)
This may help cases like #2206, since it should prompt us to try a federated join again instead.
Diffstat (limited to 'roomserver/storage')
-rw-r--r--roomserver/storage/postgres/state_snapshot_table.go2
-rw-r--r--roomserver/storage/sqlite3/state_snapshot_table.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/roomserver/storage/postgres/state_snapshot_table.go b/roomserver/storage/postgres/state_snapshot_table.go
index ce9f2463..8ed88603 100644
--- a/roomserver/storage/postgres/state_snapshot_table.go
+++ b/roomserver/storage/postgres/state_snapshot_table.go
@@ -134,7 +134,7 @@ func (s *stateSnapshotStatements) BulkSelectStateBlockNIDs(
return nil, err
}
if i != len(stateNIDs) {
- return nil, fmt.Errorf("storage: state NIDs missing from the database (%d != %d)", i, len(stateNIDs))
+ return nil, types.MissingStateError(fmt.Sprintf("storage: state NIDs missing from the database (%d != %d)", i, len(stateNIDs)))
}
return results, nil
}
diff --git a/roomserver/storage/sqlite3/state_snapshot_table.go b/roomserver/storage/sqlite3/state_snapshot_table.go
index 3c4bde3f..01df31e9 100644
--- a/roomserver/storage/sqlite3/state_snapshot_table.go
+++ b/roomserver/storage/sqlite3/state_snapshot_table.go
@@ -137,7 +137,7 @@ func (s *stateSnapshotStatements) BulkSelectStateBlockNIDs(
}
}
if i != len(stateNIDs) {
- return nil, fmt.Errorf("storage: state NIDs missing from the database (%d != %d)", i, len(stateNIDs))
+ return nil, types.MissingStateError(fmt.Sprintf("storage: state NIDs missing from the database (%d != %d)", i, len(stateNIDs)))
}
return results, nil
}