feat: sync guard - Blockieren alter Clients beim sync

This commit is contained in:
2026-08-20 23:54:04 +02:00
parent 7b883555bf
commit 59bd8abb45
19 changed files with 369 additions and 26 deletions
+5 -3
View File
@@ -27,9 +27,11 @@ public class AttachmentSyncer(LiteDbContext db, HttpClient http, byte[] syncKey)
await raw.CopyToAsync(buffer);
var encrypted = SyncCrypto.Encrypt(buffer.ToArray(), syncKey);
using var content = new ByteArrayContent(encrypted);
var resp = await http.PostAsync($"/api/sync/attachments/{storageId}", content);
resp.EnsureSuccessStatusCode();
using var request = SyncProtocol.CreateRequest(HttpMethod.Post,
$"/api/sync/attachments/{storageId}");
request.Content = new ByteArrayContent(encrypted);
using var resp = await http.SendAsync(request);
await SyncProtocol.EnsureCompatibleSuccessAsync(resp);
queue.MarkAttachmentUploaded(storageId);
}
}