SingleFileBackingStore: name its gate call apart from the base rule

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-28 00:26:22 +01:00
commit dc7be51a11

View file

@ -5093,7 +5093,7 @@ namespace GameCult.Caching
RefuseUndeclaredOnDisk(durable, upserts, removals, checks);
if (upserts.Count == 0 && removals.Count == 0 && (checks.Any() || StagedChecks.Count > 0))
return Array.Empty<(CultStagedRecord, string)>();
RefuseWriteIntoMovedStore(durable, upserts, removals);
RefuseWriteIntoMovedFile(durable, upserts, removals);
var durableRecords = durable?.Snapshot.Records ?? Array.Empty<CultPersistedRecord>();
// A record written over one the store holds is stored at a storedAt later than the one it replaces, whoever wrote that.
var replaced = durableRecords.ToDictionary(record => record.Key, record => record.StoredAt, StringComparer.Ordinal);
@ -5178,7 +5178,7 @@ namespace GameCult.Caching
return false;
}
private void RefuseWriteIntoMovedStore(Durable? durable, IReadOnlyCollection<CultStagedRecord> upserts, IReadOnlyCollection<string> removals) =>
private void RefuseWriteIntoMovedFile(Durable? durable, IReadOnlyCollection<CultStagedRecord> upserts, IReadOnlyCollection<string> removals) =>
RefuseWriteIntoMovedStore(
() => (durable?.Snapshot.Records ?? Array.Empty<CultPersistedRecord>())
.ToDictionary(record => record.Key, record => durable!.Version(record.Key), StringComparer.Ordinal),