Public Access
Stop a finished push deleting the edit made while it was in flight, and pull a newly synced type from the start
- The outbox coalesces a new save into the row a push already read, under a new operation id, but Complete, Revise and Park found the row by sequence alone. The acknowledgement of the earlier state deleted the row holding the later one and the edit was gone without a word. They now take the PendingOperation and act only while the row still holds it; a later edit is rebased onto the version just accepted, so it pushes cleanly instead of conflicting with its own earlier save. - A pull filtered by type moves the cursor past changes of types it did not ask for, so a build that added a type (SpelunkKey, ObjectStore) never received the items of that type made before it. sync_state.pulled_types records the list a cursor was read under, and a different list starts the pull over once. Migration AddSyncStatePulledTypes.
This commit is contained in:
1 parent
03c8e8589a
commit
f332d9a56f
12 files changed
+757
-31
No files matched your search
@@ -120,7 +120,7 @@ internal sealed class ItemReconciler<TSecret>(
|
||||
{
|
||||
return pending.Operation == SyncOperation.Delete
|
||||
// Both sides deleted it. Nothing to arbitrate and nothing to tell the user.
|
||||
? outbox.CompleteAsync(pending.Sequence, cancellationToken)
|
||||
? outbox.CompleteAsync(pending, cancellationToken)
|
||||
: ResurrectAsync(vaultId, remote, pending, report, cancellationToken);
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ internal sealed class ItemReconciler<TSecret>(
|
||||
}
|
||||
|
||||
await outbox.ReviseAsync(
|
||||
pending.Sequence,
|
||||
pending,
|
||||
SyncOperation.Upsert,
|
||||
expectedVersion: null,
|
||||
kind.Seal(local.Secret, vaultKey.Span, pending.EntityId, generation, itemVersion: 1),
|
||||
@@ -212,7 +212,7 @@ internal sealed class ItemReconciler<TSecret>(
|
||||
{
|
||||
// Field for field the same item: this is our own create coming back. Nothing to do but stop
|
||||
// trying to send it again.
|
||||
await outbox.CompleteAsync(pending.Sequence, cancellationToken).ConfigureAwait(false);
|
||||
await outbox.CompleteAsync(pending, cancellationToken).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ internal sealed class ItemReconciler<TSecret>(
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
|
||||
// Now the tombstone can stand.
|
||||
await outbox.CompleteAsync(pending.Sequence, cancellationToken).ConfigureAwait(false);
|
||||
await outbox.CompleteAsync(pending, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
await conflicts.RecordAsync(
|
||||
vaultId,
|
||||
@@ -385,7 +385,7 @@ internal sealed class ItemReconciler<TSecret>(
|
||||
SyncReportBuilder report,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
await outbox.CompleteAsync(pending.Sequence, cancellationToken).ConfigureAwait(false);
|
||||
await outbox.CompleteAsync(pending, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
await conflicts.RecordAsync(
|
||||
vaultId,
|
||||
@@ -413,7 +413,7 @@ internal sealed class ItemReconciler<TSecret>(
|
||||
var nextVersion = SyncVersions.NextVersion(remote.Version);
|
||||
|
||||
await outbox.ReviseAsync(
|
||||
pending.Sequence,
|
||||
pending,
|
||||
SyncOperation.Upsert,
|
||||
expectedVersion: remote.Version,
|
||||
kind.Seal(secret, vaultKey.Span, remote.EntityId, generation, nextVersion),
|
||||
@@ -486,7 +486,7 @@ internal sealed class ItemReconciler<TSecret>(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
await outbox.ParkAsync(
|
||||
pending.Sequence,
|
||||
pending,
|
||||
$"Written by a newer version of DodoSSH; update before editing this {kind.Noun}.",
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -512,7 +512,7 @@ internal sealed class ItemReconciler<TSecret>(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
await outbox.ParkAsync(
|
||||
pending.Sequence,
|
||||
pending,
|
||||
$"The local or the server copy of this {kind.Noun} could not be decrypted.",
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
|
||||
|
||||
Reference in new issue
Block a user