From 557b611b02722007c1f9e6722956f659422bced3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Wed, 27 May 2026 15:55:10 +0200 Subject: [PATCH] Include the iOS state file in the debug bundle addStateFile() resolved the state path via ServiceManager.GetStatePath(), which on iOS points at a hard-coded default that does not exist in the app sandbox, so the state file was silently skipped. Add an optional StatePath to GeneratorDependencies and use it when set, falling back to the ServiceManager default otherwise. The iOS DebugBundle passes the client's actual state file path (the App Group profile state), matching the Android bundle which includes the state file. --- client/internal/debug/debug.go | 10 ++++++++-- client/ios/NetBirdSDK/client.go | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/client/internal/debug/debug.go b/client/internal/debug/debug.go index 0a12a5326..06238ab96 100644 --- a/client/internal/debug/debug.go +++ b/client/internal/debug/debug.go @@ -235,6 +235,7 @@ type BundleGenerator struct { syncResponse *mgmProto.SyncResponse logPath string tempDir string + statePath string cpuProfile []byte capturePath string refreshStatus func() // Optional callback to refresh status before bundle generation @@ -259,6 +260,7 @@ type GeneratorDependencies struct { SyncResponse *mgmProto.SyncResponse LogPath string TempDir string // Directory for temporary bundle zip files. If empty, os.TempDir() is used. + StatePath string // Path to the state file. If empty, the ServiceManager default path is used. CPUProfile []byte CapturePath string RefreshStatus func() @@ -280,6 +282,7 @@ func NewBundleGenerator(deps GeneratorDependencies, cfg BundleConfig) *BundleGen syncResponse: deps.SyncResponse, logPath: deps.LogPath, tempDir: deps.TempDir, + statePath: deps.StatePath, cpuProfile: deps.CPUProfile, capturePath: deps.CapturePath, refreshStatus: deps.RefreshStatus, @@ -791,8 +794,11 @@ func (g *BundleGenerator) addSyncResponse() error { } func (g *BundleGenerator) addStateFile() error { - sm := profilemanager.NewServiceManager("") - path := sm.GetStatePath() + path := g.statePath + if path == "" { + sm := profilemanager.NewServiceManager("") + path = sm.GetStatePath() + } if path == "" { return nil } diff --git a/client/ios/NetBirdSDK/client.go b/client/ios/NetBirdSDK/client.go index f9b582ef2..ee9959b0f 100644 --- a/client/ios/NetBirdSDK/client.go +++ b/client/ios/NetBirdSDK/client.go @@ -217,6 +217,7 @@ func (c *Client) DebugBundle(anonymize bool) (string, error) { InternalConfig: cfg, StatusRecorder: c.recorder, TempDir: c.cacheDir, + StatePath: c.stateFile, } if cc != nil {