Review comments

This commit is contained in:
Kegan Dougal 2023-07-12 12:24:02 +01:00
parent 7380273293
commit c1b0f0b93b
4 changed files with 7 additions and 8 deletions

View File

@ -2,6 +2,7 @@ name: Tests
on:
push:
branches: ["main"]
pull_request:
permissions:

View File

@ -12,9 +12,6 @@ import (
"github.com/jmoiron/sqlx"
"github.com/matrix-org/sliding-sync/sqlutil"
"github.com/jmoiron/sqlx"
"github.com/matrix-org/sliding-sync/sqlutil"
"github.com/getsentry/sentry-go"
"github.com/matrix-org/sliding-sync/internal"
@ -55,7 +52,7 @@ type Handler struct {
}
func NewHandler(
pMap *sync2.PollerMap, v2Store *sync2.Storage, store *state.Storage,
pMap sync2.IPollerMap, v2Store *sync2.Storage, store *state.Storage,
pub pubsub.Notifier, sub pubsub.Listener, enablePrometheus bool, deviceDataUpdateDuration time.Duration,
) (*Handler, error) {
h := &Handler{

View File

@ -1,14 +1,15 @@
package handler2_test
import (
"github.com/jmoiron/sqlx"
"github.com/matrix-org/sliding-sync/sqlutil"
"os"
"reflect"
"sync"
"testing"
"time"
"github.com/jmoiron/sqlx"
"github.com/matrix-org/sliding-sync/sqlutil"
"github.com/matrix-org/sliding-sync/pubsub"
"github.com/matrix-org/sliding-sync/state"
"github.com/matrix-org/sliding-sync/sync2"
@ -127,7 +128,7 @@ func TestHandlerFreshEnsurePolling(t *testing.T) {
pMap := &mockPollerMap{}
pub := newMockPub()
sub := &mockSub{}
h, err := handler2.NewHandler(pMap, v2Store, store, pub, sub, false)
h, err := handler2.NewHandler(pMap, v2Store, store, pub, sub, false, time.Minute)
assertNoError(t, err)
alice := "@alice:localhost"
deviceID := "ALICE"

View File

@ -197,7 +197,7 @@ func (s *ConnState) onIncomingRequest(reqCtx context.Context, req *sync3.Request
internal.Logf(reqCtx, "connstate", "list[%v] prev_empty=%v curr=%v", key, l.Prev == nil, listData)
}
for roomID, sub := range s.muxedReq.RoomSubscriptions {
internal.Logf(ctx, "connstate", "room sub[%v] %v", roomID, sub)
internal.Logf(reqCtx, "connstate", "room sub[%v] %v", roomID, sub)
}
// work out which rooms we'll return data for and add their relevant subscriptions to the builder