Skip to content

v0.26.6

Choose a tag to compare

@dmitry-lebedev dmitry-lebedev released this 07 Jun 09:26
· 40 commits to main since this release

Added — deep state check debugging

Per-method opt-in CRC comparison between client and server state, with full serialized binaries surfaced to a user callback on mismatch.

[MetaMethod(Alias = "Move", Mode = ExecutionMode.Optimistic,
            DeepStateCheck = SnapshotTiming.After)]   // Before | After | Both
bool Move(int dx, int dy);

The generator emits the snapshot/CRC wrap only for annotated methods — unannotated methods compile with zero overhead.

On mismatch the framework invokes:

void IDesyncDiagnostics.OnDeepStateDesync<TState>(
    string entityId,
    byte[] clientStateBytes,
    byte[] serverStateBytes,
    SnapshotTiming timing,
    long timestampTicks)
    where TState : class;

TState is typed at compile time so user diff code can Unpack<TState> both binaries directly. Default impl is empty — existing IDesyncDiagnostics impls compile unchanged.