Be more verbose when logging state resets

This commit is contained in:
Till Faelligen 2023-11-29 09:15:04 +01:00
parent 143285708b
commit 4ae7335b01
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E

View file

@ -285,6 +285,8 @@ func (u *latestEventsUpdater) latestState(ctx context.Context, roomInfo *types.R
"new_state_nid": u.newStateNID,
"old_latest": u.oldLatest.EventIDs(),
"new_latest": u.latest.EventIDs(),
"rewrites_state": u.rewritesState,
"state_at_event": fmt.Sprintf("%#v", u.stateAtEvent),
}).Warnf("State reset detected (removing %d events)", removed)
sentry.WithScope(func(scope *sentry.Scope) {
scope.SetLevel("warning")
@ -295,6 +297,8 @@ func (u *latestEventsUpdater) latestState(ctx context.Context, roomInfo *types.R
"Old latest": u.oldLatest.EventIDs(),
"New latest": u.latest.EventIDs(),
"State removed": removed,
"State rewritten": fmt.Sprintf("%v", u.rewritesState),
"State at event": fmt.Sprintf("%#v", u.stateAtEvent),
})
sentry.CaptureMessage("State reset detected")
})