diff --git a/src/NexusMods.EventSourcing.RocksDB/RocksDBEventStore.cs b/src/NexusMods.EventSourcing.RocksDB/RocksDBEventStore.cs index f13b0937..3ad356d0 100644 --- a/src/NexusMods.EventSourcing.RocksDB/RocksDBEventStore.cs +++ b/src/NexusMods.EventSourcing.RocksDB/RocksDBEventStore.cs @@ -78,7 +78,10 @@ public override void EventsForEntity(EntityId entityId, TIngester ing BinaryPrimitives.WriteUInt64BigEndian(startKey.SliceFast(16), fromId.Value); Span endKey = stackalloc byte[24]; entityId.TryWriteBytes(endKey); - BinaryPrimitives.WriteUInt64BigEndian(endKey.SliceFast(16), toId.Value + 1); + if (toId == TransactionId.Max) + BinaryPrimitives.WriteUInt64BigEndian(endKey.SliceFast(16), ulong.MaxValue); + else + BinaryPrimitives.WriteUInt64BigEndian(endKey.SliceFast(16), toId.Value + 1); var options = new ReadOptions(); unsafe