C#: compatible schema ids publish a schema on open, Mesh takes only the older layout, the refusal names its file
A record whose schema id the catalog lists only as a compatible id now opens (the cache resolved a persisted schema by entry id alone). CultMesh's fallback to the older catalog-entry reader fires only for a store in that layout, decided by the entry's slot 5, not for any decode failure, so a current-layout store with a malformed slot is refused as CultCache refuses it. CultStoreUnreadableException.Path names the refused file. New vectors: compatible-id-only-v3 (accepted by all four) and three current-layout catalogs with one malformed slot. The contract states the writer's invariant. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d5bc28e207
commit
969d78de39
16 changed files with 118 additions and 16 deletions
|
|
@ -71,7 +71,7 @@ namespace GameCult.Caching.Tests
|
|||
if (reads)
|
||||
Assert.DoesNotThrow(Open);
|
||||
else
|
||||
Assert.That(Open, Throws.TypeOf<CultStoreUnreadableException>());
|
||||
Assert.That(Open, Throws.TypeOf<CultStoreUnreadableException>().With.Property(nameof(CultStoreUnreadableException.Path)).EqualTo(path));
|
||||
}
|
||||
|
||||
[TestCaseSource(nameof(Vectors))]
|
||||
|
|
@ -116,6 +116,7 @@ namespace GameCult.Caching.Tests
|
|||
|
||||
// A commit that lands onto the file as it is keeps the header the file carries: a store already v3 stays v3.
|
||||
[TestCase("../v3-base.msgpack", "cultcache.store.v3")]
|
||||
[TestCase("compatible-id-only-v3.bin", "cultcache.store.v3")]
|
||||
[TestCase("zero-byte.bin", "cultcache.store.v1")]
|
||||
[TestCase("empty-array.bin", "cultcache.store.v1")]
|
||||
public void AConditionalCommitOntoAReadableFileKeepsItsHeader(string vector, string header)
|
||||
|
|
|
|||
Loading…
Reference in a new issue