Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/core/internal/runtimegateway/owner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestSessionOwnerLeaseLostClosesStaleConnection(t *testing.T) {
conn := newFakeConn()
owners := &fakeOwnerStore{renewOK: false, releaseCh: make(chan struct{})}
lease := &ownerLease{store: owners, deviceID: "dev-1", ownerPodID: "pod-a", generation: 7, ttl: time.Minute}
sess := NewSessionWithOwner(conn, "dev-1", "wks-1", proto.Version, reg, nil, lease)
sess := NewSessionWithOwner(conn, "dev-1", "wks-1", proto.Version, reg, func(string, ...any) {}, lease)
reg.Register(sess)
sess.Start()

Expand Down
6 changes: 0 additions & 6 deletions services/core/internal/runtimegateway/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,6 @@ type Session struct {
// connections. The session does NOT start its goroutines automatically — Start
// runs once the handler is ready so the session can't race with response writes.
func NewSessionWithOwner(conn WSConn, deviceID, workspaceID, daemonVersion string, reg *Registry, log SessionLogger, owner *ownerLease) *Session {
if log == nil {
log = func(string, ...any) {}
}
if reg == nil {
reg = NewRegistry()
}
now := time.Now()
return &Session{
DeviceID: deviceID,
Expand Down
6 changes: 6 additions & 0 deletions services/core/internal/runtimegateway/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ import (

// NewSession builds an unowned Session over a test connection.
func NewSession(conn WSConn, deviceID, workspaceID, daemonVersion string, reg *Registry, log SessionLogger) *Session {
if log == nil {
log = func(string, ...any) {}
}
if reg == nil {
reg = NewRegistry()
}
return NewSessionWithOwner(conn, deviceID, workspaceID, daemonVersion, reg, log, nil)
}

Expand Down
Loading