feat: sync guard - Blockieren alter Clients beim sync
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user