Clarify comment

This commit is contained in:
Till Faelligen 2024-12-19 20:36:06 +01:00
parent e2fd591d9f
commit 2f11ed9fc1
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E

View file

@ -1544,6 +1544,9 @@ func (d *Database) GetBulkStateContent(ctx context.Context, roomIDs []string, tu
if roomInfo == nil || roomInfo.IsStub() { if roomInfo == nil || roomInfo.IsStub() {
continue continue
} }
// TODO: This is inefficient as we're loading the _entire_ state, but only care about a subset of it.
// This is why GetBulkStateACLs exists. LoadStateAtSnapshotForStringTuples only loads the state we care about,
// but is unfortunately not able to load wildcard state keys.
entries, err2 := d.loadStateAtSnapshot(ctx, roomInfo.StateSnapshotNID()) entries, err2 := d.loadStateAtSnapshot(ctx, roomInfo.StateSnapshotNID())
if err2 != nil { if err2 != nil {
return nil, fmt.Errorf("GetBulkStateContent: failed to load state for room %s : %w", roomID, err2) return nil, fmt.Errorf("GetBulkStateContent: failed to load state for room %s : %w", roomID, err2)