Desktop: stop decrypting the whole keychain on a sync pass that changed nothing

This commit is contained in:
jaap-jan committed 2026-10-02 14:08:08 +02:00
1 parent 873405e591
commit 441709f1e9
2 files changed
+59 -3

No files matched your search

@@ -656,6 +656,26 @@ public sealed partial class ShellFlowTests : IAsyncLifetime
vault.IsBusy.ShouldBeFalse("a background pass must never raise the busy flag");
}
/// <remarks>
/// A pass that moved nothing used to read the whole keychain back anyway — decrypting every item and
/// rebuilding every list, once a minute. A rebuilt list has new row objects in it, so the row still being
/// the same object is the evidence that nothing was read.
/// </remarks>
[Fact]
public async Task AnAutomaticPassThatMovesNothing_RedrawsNothing()
{
await UnlockedAsync();
var vault = shell.Vault!;
await AddHostAsync(vault, "prod-db");
var row = vault.Hosts.ShouldHaveSingleItem();
await vault.AutoSyncAsync(Token);
vault.Hosts.ShouldHaveSingleItem().ShouldBeSameAs(row);
}
/// <remarks>
/// The queue has to be arranged by failing the automatic push first. Written the obvious way — add a
/// host, then call the pass — this test proved nothing at all: saving pushes, so there was no pending