From 440bef7e2df331782836604d2c12727821925960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Wed, 7 Oct 2026 14:25:19 +0200 Subject: [PATCH] [client] Populate the pending extend flow in the test server helper SwitchProfile cancels and clears the pending session extend flow unconditionally, the same way it clears the SSH JWT cache. New always populates the field, but the hand-assembled test server did not, so TestSwitchProfile_ClearsJWTCache panicked on a nil PendingFlow. --- client/server/server_connect_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/server/server_connect_test.go b/client/server/server_connect_test.go index dc191a44f..28bbfccde 100644 --- a/client/server/server_connect_test.go +++ b/client/server/server_connect_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/require" "github.com/netbirdio/netbird/client/internal" + "github.com/netbirdio/netbird/client/internal/auth" "github.com/netbirdio/netbird/client/internal/peer" "github.com/netbirdio/netbird/client/proto" ) @@ -21,7 +22,8 @@ func newTestServer() *Server { // New always populates the SSH JWT cache and the logout and // profile-switch paths call into it unconditionally, so a Server // assembled field by field has to populate it too. - jwtCache: newJWTCache(), + jwtCache: newJWTCache(), + extendAuthSessionFlow: auth.NewPendingFlow(), } }