fix(copies): close the owner review 6 second verification findings
Upload again now deletes the gone pair row once the new sequence is linked, so the pair stops reading "deleted on server" or "kept here". A linked upload the server refuses into its sequence (403 for an account without Edit that does not own it) falls back to ordinary uploads instead of failing; an Integrate that would add photos to such a sequence is blocked in its plan (NoAddRight). Automatic photo transfers pause on a metered connection whatever the option says. Integrate trashes server photos only against the manifest version that checked the winner, and a merge is blocked while the other sequence holds a damaged photo nothing else holds (DamagedPhotos), so nothing unverified reaches the trash. The plan and the confirmations now say what really happens: replaced versions are no longer counted as kept, a merge lists the kept sequence's replaced photos, plan lines use the text colour, an integrated pair that left photos out says new photos move by hand, and a merging pair reads "merging" with its progress. The Compare dialog gets per-side tooltips, class sizes for both sides, policy-aware class tooltips, column headings and readable file names; the sync table shows "deleted there" with Review and warns on skipped rows; the Edit picker names the server, the Library card shows the match status second, a deleted server sequence is named instead of "0 photos", and the match tooltips stop calling a sequence a copy. The capture scenes use the server name, the link names and consistent sample sizes. Refs #73 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b34b6b6fe0
commit
9657c1711d
44 files changed
+802
-128
No files matched your search
@@ -79,6 +79,17 @@ internal sealed class FakeSyncRemote : ISyncRemote
|
||||
|
||||
public int CopiedInto { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Uploads into a target refused with 403, as for an account with Read and Upload but not Edit that does not own the
|
||||
/// target; <see cref="RefusedInto"/> counts them.
|
||||
/// </summary>
|
||||
public bool ForbidInto { get; set; }
|
||||
|
||||
public int RefusedInto { get; private set; }
|
||||
|
||||
/// <summary>Runs once, before the next frame deletion is answered (the server sequence changing meanwhile).</summary>
|
||||
public Action? OnceBeforeDelete { get; set; }
|
||||
|
||||
/// <summary>Frame deletions refused with 403, as for an account that is neither the owner nor an admin.</summary>
|
||||
public bool ForbidFrameDeletes { get; set; }
|
||||
|
||||
@@ -139,6 +150,11 @@ internal sealed class FakeSyncRemote : ISyncRemote
|
||||
bool capable;
|
||||
lock (_gate) capable = Capabilities.Contains(ServerCapabilities.UploadInto);
|
||||
if (!capable) return await UploadFileAsync(path, sequenceId, null, sha256, capturedAt, cancellationToken);
|
||||
if (ForbidInto)
|
||||
{
|
||||
lock (_gate) RefusedInto++;
|
||||
throw new ChronosApiException(HttpStatusCode.Forbidden, new ApiError("forbidden", "into"));
|
||||
}
|
||||
var bytes = await File.ReadAllBytesAsync(path, cancellationToken);
|
||||
if (Convert.ToHexStringLower(SHA256.HashData(bytes)) != sha256)
|
||||
throw new ChronosApiException(HttpStatusCode.BadRequest, new ApiError("hash_mismatch", "hash"));
|
||||
@@ -162,6 +178,11 @@ internal sealed class FakeSyncRemote : ISyncRemote
|
||||
/// </summary>
|
||||
public Task<FrameDeleteResultDto> DeleteFramesAsync(Guid sequenceId, FrameDeleteRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
if (OnceBeforeDelete is { } before)
|
||||
{
|
||||
OnceBeforeDelete = null;
|
||||
before();
|
||||
}
|
||||
lock (_gate)
|
||||
{
|
||||
var sequence = Find(sequenceId);
|
||||
@@ -492,7 +513,10 @@ internal sealed class FakeSequence
|
||||
}
|
||||
|
||||
public SequenceDto Dto() => new(Id, Title, Title ?? "Untitled", "2026/" + Id.ToString("N"), "Canon", CameraModel, null, FirstCapture, null, Frames.Count, 10,
|
||||
Frames.Sum(f => (long)f.Bytes.Length), (long)Status, Renders.Count, null, Tags, Rating, Notes, SettingsVersion, FramesVersion, 0, null, UpdatedAt);
|
||||
Frames.Sum(f => (long)f.Bytes.Length), (long)Status, Renders.Count, null, Tags, Rating, Notes, SettingsVersion, FramesVersion, 0, OwnerUserId, UpdatedAt);
|
||||
|
||||
/// <summary>The server account that owns the sequence (none by default).</summary>
|
||||
public Guid? OwnerUserId { get; set; }
|
||||
|
||||
public SequenceManifest Manifest(Func<Guid, bool> proxySent) => new(Id, FramesVersion, SettingsVersion, SettingsJson, Tags,
|
||||
[.. Frames.Select((f, i) => new ManifestFrame(f.Id, i, f.FileName, f.Bytes.Length, Unhashed ? string.Empty : f.Sha256,
|
||||
|
||||
Reference in new issue
Block a user