mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
Remove debug and improve comments
This commit is contained in:
parent
0bc33f3451
commit
0d4e8c6df9
@ -318,8 +318,11 @@ func (a *Accumulator) Initialise(roomID string, state []json.RawMessage) (Initia
|
||||
}
|
||||
|
||||
type AccumulateResult struct {
|
||||
// TODO: is this redundant---identical to len(TimelineNIDs)?
|
||||
NumNew int
|
||||
// NumNew is the number of events in timeline NIDs that were not previously known
|
||||
// to the proyx.
|
||||
NumNew int
|
||||
// TimelineNIDs is the list of event nids seen in a sync v2 timeline. Some of these
|
||||
// may already be known to the proxy.
|
||||
TimelineNIDs []int64
|
||||
// RequiresReload is set to true when we have accumulated a non-incremental state
|
||||
// change (typically a redaction) that requires consumers to reload the room state
|
||||
|
@ -301,7 +301,7 @@ func (h *Handler) Accumulate(ctx context.Context, userID, deviceID, roomID, prev
|
||||
return err
|
||||
}
|
||||
|
||||
// TODO: does the ordering of this versus V2Accumulate matter here?
|
||||
// Consumers should reload state before processing new timeline events.
|
||||
if accResult.RequiresReload {
|
||||
h.v2Pub.Notify(pubsub.ChanV2, &pubsub.V2InvalidateRoom{
|
||||
RoomID: roomID,
|
||||
|
@ -396,11 +396,9 @@ func (c *GlobalCache) OnInvalidateRoom(ctx context.Context, roomID string) {
|
||||
return
|
||||
}
|
||||
|
||||
logger.Warn().Any("before", metadata).Msgf("DMR: invalidate GLOBALLLLLL room %s", roomID)
|
||||
err := c.store.ResetMetadataState(metadata)
|
||||
if err != nil {
|
||||
internal.GetSentryHubFromContextOrDefault(ctx).CaptureException(err)
|
||||
logger.Warn().Err(err).Msg("OnInvalidateRoom: failed to reset metadata")
|
||||
}
|
||||
logger.Warn().Any("after", metadata).Msgf("DMR: invalidate GLOBALLLLLL room %s", roomID)
|
||||
}
|
||||
|
@ -752,5 +752,8 @@ func (u *UserCache) ShouldIgnore(userID string) bool {
|
||||
}
|
||||
|
||||
func (u *UserCache) OnInvalidateRoom(ctx context.Context, roomID string) {
|
||||
logger.Warn().Msgf("DMR: invalidate USERRRRRRR room %s", roomID)
|
||||
// Nothing for now. In UserRoomData the fields dependant on room state are
|
||||
// IsDM, IsInvite, HasLeft, Invite, CanonicalisedName, ResolvedAvatarURL, Spaces.
|
||||
// Not clear to me if we need to reload these or if we will inherit any changes from
|
||||
// the global cache.
|
||||
}
|
||||
|
@ -806,7 +806,6 @@ func (h *SyncLiveHandler) OnInvalidateRoom(p *pubsub.V2InvalidateRoom) {
|
||||
ctx, task := internal.StartTask(context.Background(), "OnInvalidateRoom")
|
||||
defer task.End()
|
||||
|
||||
logger.Warn().Msgf("DMR: invalidate room %s", p.RoomID)
|
||||
h.GlobalCache.OnInvalidateRoom(ctx, p.RoomID)
|
||||
h.Dispatcher.OnInvalidateRoom(ctx, p.RoomID)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user