0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-12-14 06:53:49 +01:00

Bypass lazyLoadCache if we're doing an initial sync

This commit is contained in:
Till Faelligen 2022-08-05 07:58:39 +02:00
parent 9a655cb5e7
commit 3909d9d078
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E

View file

@ -497,6 +497,11 @@ func (p *PDUStreamProvider) lazyLoadMembers(
} }
// Add all users the client doesn't know about yet to a list // Add all users the client doesn't know about yet to a list
for _, event := range timelineEvents { for _, event := range timelineEvents {
// If we're doing an initial sync, add all users to the state events, bypassing the cache
if !incremental {
timelineUsers[event.Sender()] = struct{}{}
continue
}
// Membership is not yet cached, add it to the list // Membership is not yet cached, add it to the list
if _, ok := p.lazyLoadCache.IsLazyLoadedUserCached(device, roomID, event.Sender()); !ok { if _, ok := p.lazyLoadCache.IsLazyLoadedUserCached(device, roomID, event.Sender()); !ok {
timelineUsers[event.Sender()] = struct{}{} timelineUsers[event.Sender()] = struct{}{}