[client] avoid overwriting state manager on iOS (#3870)

This commit is contained in:
Pascal Fischer 2025-05-23 14:04:12 +02:00 committed by GitHub
parent 2a89d6e47a
commit a0482ebc7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -241,6 +241,8 @@ func NewEngine(
checks: checks, checks: checks,
connSemaphore: semaphoregroup.NewSemaphoreGroup(connInitLimit), connSemaphore: semaphoregroup.NewSemaphoreGroup(connInitLimit),
} }
path := statemanager.GetDefaultStatePath()
if runtime.GOOS == "ios" { if runtime.GOOS == "ios" {
if !fileExists(mobileDep.StateFilePath) { if !fileExists(mobileDep.StateFilePath) {
err := createFile(mobileDep.StateFilePath) err := createFile(mobileDep.StateFilePath)
@ -250,11 +252,9 @@ func NewEngine(
} }
} }
engine.stateManager = statemanager.New(mobileDep.StateFilePath) path = mobileDep.StateFilePath
}
if path := statemanager.GetDefaultStatePath(); path != "" {
engine.stateManager = statemanager.New(path)
} }
engine.stateManager = statemanager.New(path)
return engine return engine
} }