Connect to several servers, one coloured window each

This commit is contained in:
Ian Gulliver
2026-10-18 20:58:56 -07:00
parent c0b2f38584
commit 4347d4e9e4
15 changed files with 456 additions and 209 deletions
+2 -2
View File
@@ -20,12 +20,12 @@ private enum SnapshotPatches {
static var patches: [String: Task<String?, any Error>] = [:]
static func patch(_ api: API, _ taskId: String, _ n: Int, _ path: String) async throws -> String? {
let key = "\(taskId)/\(n)/\(path)"
let key = "\(api.origin.absoluteString)/\(taskId)/\(n)/\(path)"
if let cached = patches[key] {
return try await cached.value
}
let fetched = Task<String?, any Error> {
let ck = "\(taskId)/\(n)"
let ck = "\(api.origin.absoluteString)/\(taskId)/\(n)"
let pending = changes[ck] ?? Task {
try await api.client.getTaskChanges(path: .init(taskId: taskId), query: .init(snapshot: n)).ok.body.json
}