diff --git a/src/GameCult.Caching.MessagePack/DirectoryMessagePackBackingStore.cs b/src/GameCult.Caching.MessagePack/DirectoryMessagePackBackingStore.cs index d078999a..20f00c2e 100644 --- a/src/GameCult.Caching.MessagePack/DirectoryMessagePackBackingStore.cs +++ b/src/GameCult.Caching.MessagePack/DirectoryMessagePackBackingStore.cs @@ -339,11 +339,14 @@ public sealed class DirectoryMessagePackBackingStore : CacheBackingStore var started = tracePages ? Stopwatch.GetTimestamp() : 0L; var metadata = records[index]; var record = ReadPersistedRecordPage(metadata, out var pagePayload); - storedRecords[index] = ToStoredDocument( + var stored = ToStoredDocument( record, catalogEntries, (type, payload) => CultDocumentMessagePackSerialization.DeserializeUntyped(type, payload, Registry), out recordReports[index]); + // The manifest is this store's record of what is on disk, and what a commit condition compares with. + stored.StoredSchemaId = metadata.SchemaId; + storedRecords[index] = stored; if (tracePages) { pageBytes[index] = pagePayload.LongLength; diff --git a/tests/GameCult.Caching.Tests/CompatibleSchemaIdTests.cs b/tests/GameCult.Caching.Tests/CompatibleSchemaIdTests.cs index e6b5c3e2..f76d023d 100644 --- a/tests/GameCult.Caching.Tests/CompatibleSchemaIdTests.cs +++ b/tests/GameCult.Caching.Tests/CompatibleSchemaIdTests.cs @@ -354,7 +354,7 @@ namespace GameCult.Caching.Tests using (var cache = Open(path, Declaring)) { cache.Commit(batch => batch.Upsert(typeof(DeclaringDeck), new DeclaringDeck { Name = "b" }, b)); - cache.Commit(batch => batch.UpsertVariant(v, b)); + cache.Commit(batch => batch.UpsertVariant(v, b, new[] { cache.Override(typeof(DeclaringDeck), nameof(DeclaringDeck.Name), "v") })); } Rewrite(path, snapshot =>