From 5b74a346df81304f0cf4e02856e42844b5feb3ac Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Thu, 16 Jul 2026 12:33:40 -0700 Subject: [PATCH] docs(saves): note the failure mode if the type-table invariant guard fires Co-Authored-By: Claude Fable 5 --- Projects/Server/Serialization/GenericEntityPersistence.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Projects/Server/Serialization/GenericEntityPersistence.cs b/Projects/Server/Serialization/GenericEntityPersistence.cs index 48288fde4..a49f213eb 100644 --- a/Projects/Server/Serialization/GenericEntityPersistence.cs +++ b/Projects/Server/Serialization/GenericEntityPersistence.cs @@ -293,6 +293,10 @@ public class GenericEntityPersistence : GenericPersistence, IGenericEntityPer private ushort GetTypeIndex(T entity) { + // Every path into EntitiesBySerial registers the type first, so this cannot fire. + // If it ever does, the segment-level catch in WriteSnapshot logs it and moves on — + // the failed segment's records are dropped from the idx while binPosition rewinds, + // so treat any occurrence as a serious bug in an insertion path, not a bad entity. if (!_typeIndexes.TryGetValue(entity.GetType(), out var typeIndex)) { throw new InvalidOperationException(