From c542dae2b5bae2f4785a01f7f0f70ac54fdfa880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Tue, 25 Aug 2026 15:15:07 +0200 Subject: [PATCH] [client] Skip the sweeper dial option without a netevents manager Review feedback on #7254: restore the nil guard around WithSweeper in the signal and management clients. The nil *Manager is safe through the whole dial chain, but passing it into the Sweeper interface hides that behind a typed nil, and on desktop, where the manager is always nil, the extra context dialer overrode WithCustomDialer just to be a no-op. --- shared/management/client/grpc.go | 4 +++- shared/signal/client/grpc.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/shared/management/client/grpc.go b/shared/management/client/grpc.go index 82ad305a9..50bf36ac1 100644 --- a/shared/management/client/grpc.go +++ b/shared/management/client/grpc.go @@ -142,7 +142,9 @@ func NewClient(ctx context.Context, addr string, ourPrivateKey wgtypes.Key, tlsE extraOpts = append(extraOpts, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxSize))) log.Infof("management gRPC max receive message size set to %d bytes", maxSize) } - extraOpts = append(extraOpts, nbgrpc.WithSweeper(c.netMgr)) + if c.netMgr != nil { + extraOpts = append(extraOpts, nbgrpc.WithSweeper(c.netMgr)) + } var conn *grpc.ClientConn operation := func() error { diff --git a/shared/signal/client/grpc.go b/shared/signal/client/grpc.go index 37e64b89a..a0bb2f080 100644 --- a/shared/signal/client/grpc.go +++ b/shared/signal/client/grpc.go @@ -116,7 +116,9 @@ func NewClient(ctx context.Context, addr string, key wgtypes.Key, tlsEnabled boo } var extraOpts []grpc.DialOption - extraOpts = append(extraOpts, nbgrpc.WithSweeper(c.netMgr)) + if c.netMgr != nil { + extraOpts = append(extraOpts, nbgrpc.WithSweeper(c.netMgr)) + } var conn *grpc.ClientConn operation := func() error {