Reconnect the app's command channel after sleep; list clients from it

This commit is contained in:
Ian Gulliver
2026-10-18 09:16:31 -07:00
parent 931d1b9a96
commit 1363a3604d
11 changed files with 444 additions and 388 deletions
+3
View File
@@ -95,6 +95,8 @@ func errorText(_ error: any Error) -> String {
return String(describing: e)
}
private let clientID = UUID().uuidString
final class API: Sendable {
let origin: URL
let session: URLSession
@@ -104,6 +106,7 @@ final class API: Sendable {
self.origin = origin
let config = URLSessionConfiguration.default
config.httpAdditionalHeaders = [
"Byre-Client": clientID,
"Byre-Commit": Bundle.main.object(forInfoDictionaryKey: "ByreCommit") as! String,
"Byre-Host": Host.current().localizedName ?? ProcessInfo.processInfo.hostName,
]