fix: lock main session deletion

This commit is contained in:
Peter Steinberger
2026-01-03 23:57:17 +00:00
parent e17c038d18
commit 5862f95bd2
19 changed files with 225 additions and 20 deletions

View File

@@ -32,7 +32,7 @@ import Testing
}
"""
let key = try GatewayConnection.mainSessionKey(fromConfigGetData: Data(json.utf8))
#expect(key == "primary")
#expect(key == "main")
}
@Test func configGetSnapshotMainKeyFallsBackWhenEmptyOrWhitespace() throws {
@@ -54,4 +54,14 @@ import Testing
let key = try GatewayConnection.mainSessionKey(fromConfigGetData: Data(json.utf8))
#expect(key == "main")
}
@Test func configGetSnapshotUsesGlobalScope() throws {
let json = """
{
"config": { "session": { "scope": "global" } }
}
"""
let key = try GatewayConnection.mainSessionKey(fromConfigGetData: Data(json.utf8))
#expect(key == "global")
}
}