fix(sync): record scan stamps after a pulled title only when the index held the folder
ApplyLocallyAsync recorded the folder's scan stamps unconditionally after writing the server's title, tags, rating or notes into the sidecar. Photos another process (a desktop sharing this archive) had listed there since this index last synced the folder then stayed out of the index until the folder changed again, and the row's frames version stayed behind the sidecar's, so analyses here recorded nothing for the sequence meanwhile. It now asks ArchiveIndexer.InStepAsync before its sidecar write, as the other partial writers do, and records the stamps only when that held. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
2 files changed
+34
-1
No files matched your search
@@ -767,6 +767,9 @@ public sealed class SyncService
|
||||
if (metadata)
|
||||
{
|
||||
var manifest = SequenceWriter.ReadLocked(folder, row.Id);
|
||||
// Asked before the sidecar is written: frames or flags another process wrote there since this index last
|
||||
// synced the folder keep it changed for the next scan (ArchiveIndexer.InStepAsync).
|
||||
var inStep = await Archives.Indexer.InStepAsync(archive, folder, manifest, cancellationToken).ConfigureAwait(false);
|
||||
ManifestStore.WriteSequence(folder.ManifestPath, manifest with
|
||||
{
|
||||
Title = updated.Title,
|
||||
@@ -776,7 +779,7 @@ public sealed class SyncService
|
||||
Versions = manifest.Versions with { Settings = Math.Max(manifest.Versions.Settings, updated.SettingsVersion) },
|
||||
UpdatedAt = DateTimeOffset.UtcNow,
|
||||
});
|
||||
await Archives.Indexer.RecordStampsAsync(archive, folder, row.Id, cancellationToken).ConfigureAwait(false);
|
||||
if (inStep) await Archives.Indexer.RecordStampsAsync(archive, folder, row.Id, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
return updated;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user