mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
Add some more tracing and logging
This commit is contained in:
parent
f3e07c529b
commit
3510682b58
@ -308,6 +308,8 @@ func (c *UserCache) OnRegistered(ctx context.Context) error {
|
||||
|
||||
// Load timelines from the database. Uses cached UserRoomData for metadata purposes only.
|
||||
func (c *UserCache) LazyLoadTimelines(ctx context.Context, loadPos int64, roomIDs []string, maxTimelineEvents int) map[string]UserRoomData {
|
||||
_, span := internal.StartSpan(ctx, "LazyLoadTimelines")
|
||||
defer span.End()
|
||||
if c.LazyRoomDataOverride != nil {
|
||||
return c.LazyRoomDataOverride(loadPos, roomIDs, maxTimelineEvents)
|
||||
}
|
||||
@ -408,6 +410,8 @@ func (c *UserCache) Invites() map[string]UserRoomData {
|
||||
// which would cause the transaction ID to be missing from the event. Instead, we always look for txn
|
||||
// IDs in the v2 poller, and then set them appropriately at request time.
|
||||
func (c *UserCache) AnnotateWithTransactionIDs(ctx context.Context, userID string, deviceID string, roomIDToEvents map[string][]json.RawMessage) map[string][]json.RawMessage {
|
||||
_, span := internal.StartSpan(ctx, "AnnotateWithTransactionIDs")
|
||||
defer span.End()
|
||||
var eventIDs []string
|
||||
eventIDToEvent := make(map[string]struct {
|
||||
roomID string
|
||||
|
@ -591,6 +591,8 @@ func (s *ConnState) getInitialRoomData(ctx context.Context, roomSub sync3.RoomSu
|
||||
roomToTimeline = s.userCache.AnnotateWithTransactionIDs(ctx, s.userID, s.deviceID, roomToTimeline)
|
||||
rsm := roomSub.RequiredStateMap(s.userID)
|
||||
|
||||
internal.Logf(ctx, "connstate", "getInitialRoomData for %d rooms, RequiredStateMap: %#v", len(roomIDs), rsm)
|
||||
|
||||
// Filter out rooms we are only invited to, as we don't need to fetch the state
|
||||
// since we'll be using the invite_state only.
|
||||
loadRoomIDs := make([]string, 0, len(roomIDs))
|
||||
|
Loading…
x
Reference in New Issue
Block a user