test(sync): upload, download, resume, proxies and live events against the real server

The first original of an upload now creates the server sequence through its
session key (the archive ingest files API-created empty sequences nowhere), and
settings sent after an upload are retried when the server's own analysis edits
the new sequence meanwhile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-02 22:44:20 +00:00
1 parent 7f542646b4
commit c02d1867d0
9 files changed
+420 -49

No files matched your search

+9 -10
View File
@@ -23,16 +23,17 @@ public interface ISyncRemote : IDisposable
/// <summary>Every frame row of a sequence, in index order.</summary>
Task<IReadOnlyList<FrameDto>> ListFramesAsync(Guid sequenceId, CancellationToken cancellationToken);
Task<SequenceDto> CreateSequenceAsync(CreateSequenceRequest request, CancellationToken cancellationToken);
/// <summary>A 409 <see cref="TitanoApiException"/> means the settings version moved on the server.</summary>
Task<SequenceDto> UpdateSequenceAsync(Guid id, UpdateSequenceRequest request, CancellationToken cancellationToken);
/// <summary>
/// Chunked, resumable upload of one original that the server verifies against <paramref name="sha256"/> before
/// committing it (BRIEF §14.4); see <see cref="TitanoClient.UploadFileAsync"/>.
/// Chunked, resumable upload of one original into <paramref name="sequenceId"/>, or into the sequence the server
/// files <paramref name="sessionKey"/> under (created by the first one); the server verifies <paramref name="sha256"/>
/// before committing it (BRIEF §14.4). An original the server already holds is not sent again: the response then
/// names <paramref name="sequenceId"/> (<see cref="Guid.Empty"/> without one). See <see cref="TitanoClient.UploadFileAsync"/>.
/// </summary>
Task<CompleteUploadResponse?> UploadFileAsync(string path, Guid sequenceId, string sha256, DateTime? capturedAt, CancellationToken cancellationToken);
Task<CompleteUploadResponse?> UploadFileAsync(string path, Guid? sequenceId, string? sessionKey, string sha256, DateTime? capturedAt,
CancellationToken cancellationToken);
/// <summary>Streams a frame's original, proxy or thumb, resuming with Range from the destination's length.</summary>
Task DownloadFrameAsync(Guid frameId, string kind, Stream destination, CancellationToken cancellationToken);
@@ -88,14 +89,12 @@ public sealed class TitanoSyncRemote(TitanoClient client, bool ownsClient) : ISy
return all;
}
public Task<SequenceDto> CreateSequenceAsync(CreateSequenceRequest request, CancellationToken cancellationToken) =>
client.CreateSequenceAsync(request, cancellationToken);
public Task<SequenceDto> UpdateSequenceAsync(Guid id, UpdateSequenceRequest request, CancellationToken cancellationToken) =>
client.UpdateSequenceAsync(id, request, cancellationToken);
public Task<CompleteUploadResponse?> UploadFileAsync(string path, Guid sequenceId, string sha256, DateTime? capturedAt, CancellationToken cancellationToken) =>
client.UploadFileAsync(path, sequenceId, capturedAt, null, sha256, null, cancellationToken);
public Task<CompleteUploadResponse?> UploadFileAsync(string path, Guid? sequenceId, string? sessionKey, string sha256, DateTime? capturedAt,
CancellationToken cancellationToken) =>
client.UploadFileAsync(path, sequenceId, capturedAt, sessionKey, sha256, null, cancellationToken);
public Task DownloadFrameAsync(Guid frameId, string kind, Stream destination, CancellationToken cancellationToken) =>
client.DownloadFrameAsync(frameId, kind, destination, null, cancellationToken);