From 236f065953b2ca23117ac77c42777e8af6d60474 Mon Sep 17 00:00:00 2001 From: Kegan Dougal <7190048+kegsay@users.noreply.github.com> Date: Fri, 12 Apr 2024 08:34:37 +0100 Subject: [PATCH] Given we only process 1 update in this function, return not break --- sync3/extensions/account_data.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sync3/extensions/account_data.go b/sync3/extensions/account_data.go index b98f7a1..a84d7f2 100644 --- a/sync3/extensions/account_data.go +++ b/sync3/extensions/account_data.go @@ -53,7 +53,7 @@ func (r *AccountDataRequest) AppendLive(ctx context.Context, res *Response, extC } case caches.RoomUpdate: if !r.RoomInScope(update.RoomID(), extCtx) { - break + return } // if this is a room update which is included in the response, send account data for this room if _, exists := extCtx.RoomIDToTimeline[update.RoomID()]; exists { @@ -62,7 +62,7 @@ func (r *AccountDataRequest) AppendLive(ctx context.Context, res *Response, extC // we've loaded this room before, don't do it again // this can happen when we consume lots of items in the buffer. If many of them are room updates // for the same room, we could send dupe room account data if we didn't do this check. - break + return } roomAccountData, err := extCtx.Store.AccountDatas(extCtx.UserID, update.RoomID()) if err != nil {