Skip to content

Commit

Permalink
Given we only process 1 update in this function, return not break
Browse files Browse the repository at this point in the history
  • Loading branch information
kegsay committed Apr 12, 2024
1 parent 48b5a54 commit 236f065
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sync3/extensions/account_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 236f065

Please sign in to comment.