mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
bugfix: ensure we don't append nothing else we can end up with null arrays
Caught by element-web cypress tests, which consistently failed.
This commit is contained in:
parent
c063352508
commit
3c964de004
@ -53,7 +53,9 @@ func (r *AccountDataRequest) AppendLive(ctx context.Context, res *Response, extC
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Err(err).Str("user", extCtx.UserID).Str("room", update.RoomID()).Msg("failed to fetch room account data")
|
logger.Err(err).Str("user", extCtx.UserID).Str("room", update.RoomID()).Msg("failed to fetch room account data")
|
||||||
} else {
|
} else {
|
||||||
roomToMsgs[update.RoomID()] = accountEventsAsJSON(roomAccountData)
|
if len(roomAccountData) > 0 { // else we can end up with `null` not `[]`
|
||||||
|
roomToMsgs[update.RoomID()] = accountEventsAsJSON(roomAccountData)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user