diff --git a/keyserver/internal/device_list_update.go b/keyserver/internal/device_list_update.go index db364e258..2e465e455 100644 --- a/keyserver/internal/device_list_update.go +++ b/keyserver/internal/device_list_update.go @@ -116,7 +116,7 @@ func (u *DeviceListUpdater) Start() error { // This is important for sytest as when the /send transaction 200 OKs it assumes that // keys have been fetched and will then issue requests to /keys/query which it expects // to be satisfied from the cache (which it won't be if we haven't processed it yet). - ch := make(chan gomatrixserverlib.ServerName, 0) + ch := make(chan gomatrixserverlib.ServerName) u.workerChans[i] = ch go u.worker(ch) } diff --git a/syncapi/internal/keychange.go b/syncapi/internal/keychange.go index 66134d791..b12c13f3f 100644 --- a/syncapi/internal/keychange.go +++ b/syncapi/internal/keychange.go @@ -116,6 +116,13 @@ func DeviceListCatchup( userSet[userID] = true } } + // set the new token + to.SetLog(DeviceListLogName, &types.LogPosition{ + Partition: queryRes.Partition, + Offset: queryRes.Offset, + }) + res.NextBatch = to.String() + return hasNew, nil } diff --git a/syncapi/types/types.go b/syncapi/types/types.go index f465d9fff..a3299c7fa 100644 --- a/syncapi/types/types.go +++ b/syncapi/types/types.go @@ -112,6 +112,9 @@ type StreamingToken struct { } func (t *StreamingToken) SetLog(name string, lp *LogPosition) { + if t.logs == nil { + t.logs = make(map[string]*LogPosition) + } t.logs[name] = lp }