Writers: drop the same-tier dedupe refusal (unreachable), and pin tie order and the registered lister

Two entries of one tier that share an own id are refused when the id is carried, so a refusal at dedupe could never fire.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-30 10:14:33 +02:00
commit ca0b62023d
6 changed files with 66 additions and 29 deletions

View file

@ -204,6 +204,19 @@ namespace GameCult.Caching.Tests
}
}
// Entries of one tier that tie are taken in one fixed order: the catalog does not depend on the order they arrive in.
[Test]
public void EntriesThatTieAreTakenInOneFixedOrder()
{
var one = Entry("x", "n", "h1", "x");
var two = Entry("x", "n", "h2", "x", "y");
foreach (var order in new[] { new[] { one, two }, new[] { two, one } })
{
Assert.That(CultSchemaCatalogEntry.Derive(new[] { Rec("a", "x") }, order, Array.Empty<CultSchemaCatalogEntry>()).Single().ContentHash, Is.EqualTo("h1"));
Assert.That(CultSchemaCatalogEntry.Derive(new[] { Rec("a", "x") }, Array.Empty<CultSchemaCatalogEntry>(), order).Single().ContentHash, Is.EqualTo("h1"));
}
}
[Test]
public void TwoArrivedEntriesThatShareAnOwnIdAndDisagreeOnTheSchemaNameRefuseTheWrite()
{