From 267ff356eae57a739a59906aa594fdd84cb5418f Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 13 Jul 2026 21:10:54 +0100 Subject: [PATCH] Honor schema aliases in store publications --- src/GameCult.Mesh/CultMesh.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/GameCult.Mesh/CultMesh.cs b/src/GameCult.Mesh/CultMesh.cs index e37b07b1..4ec7940f 100644 --- a/src/GameCult.Mesh/CultMesh.cs +++ b/src/GameCult.Mesh/CultMesh.cs @@ -3315,9 +3315,16 @@ namespace GameCult.Mesh private static TDocument ReadRequired(CultCache cache, CultRecordKey key) where TDocument : class { - return cache.Get(key) - ?? throw new KeyNotFoundException( - $"CultMesh document '{key.Value}' was not found as {typeof(TDocument).FullName}."); + var document = cache.Get(key); + if (document != null) + return document; + + var untyped = cache.Get(key); + if (untyped != null && IsSameCultDocumentSchema(untyped.GetType())) + return ConvertUntypedDocument(untyped); + + throw new KeyNotFoundException( + $"CultMesh document '{key.Value}' was not found as {typeof(TDocument).FullName}."); } private static async Task ReadRequiredAsync(