docs(saves): note the failure mode if the type-table invariant guard fires
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
3b11a376f0
commit
5b74a346df
1 changed files with 4 additions and 0 deletions
|
|
@ -293,6 +293,10 @@ public class GenericEntityPersistence<T> : 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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue