Skip to content

Type Alias: SyncServerError

SyncServerError = { kind: "mutation-error"; clientGroupID: string; clientID: string; mutationID: number; mutationName: string; cause: unknown; } | { kind: "onPushed-failed"; clientGroupID: string; clientID: string; cause: unknown; } | { kind: "protocol-mismatch"; expected: number; got: number; } | { kind: "schema-mismatch"; expected: string; got: string; } | { kind: "unauthorized"; } | { kind: "invalid-request"; reason: string; } | { kind: "blob-invalid-request"; reason: string; } | { kind: "blob-not-found"; hash: string; } | { kind: "blob-read-auth-cap-hit"; hash: string; cap: number; } | { kind: "blob-hash-mismatch"; hash: string; reason: string; } | { kind: "blob-upload-failed-server"; hash: string; cause: unknown; } | { kind: "audit-serialization-exhausted"; clientGroupID: string; clientID: string; mutationID: number; mutationName: string; cause: unknown; } | { kind: "audit-onCheckpoint-failed"; scope: string; tileIndex: number; cause: unknown; } | { kind: "audit-schema-not-ready"; cause: unknown; }

Defined in: server/src/sync-handler.ts:70

Server-side sync events. Emit through SyncHandlerOptions.onError to observability sinks (Sentry, structured logs, custom telemetry). The discriminated kind lets callers dispatch by class without stringly-typed regex on error messages.

{ kind: "mutation-error"; clientGroupID: string; clientID: string; mutationID: number; mutationName: string; cause: unknown; }


{ kind: "onPushed-failed"; clientGroupID: string; clientID: string; cause: unknown; }


{ kind: "protocol-mismatch"; expected: number; got: number; }


{ kind: "schema-mismatch"; expected: string; got: string; }


{ kind: "unauthorized"; }


{ kind: "invalid-request"; reason: string; }


{ kind: "blob-invalid-request"; reason: string; }


{ kind: "blob-not-found"; hash: string; }


{ kind: "blob-read-auth-cap-hit"; hash: string; cap: number; }

readonly kind: "blob-read-auth-cap-hit"

Fired when assertCanReadBlob walked the whole readAuthMaxRefs window without finding a readable owner and the window was fully saturated (refs.length === cap). Signals that the reverse-lookup cap is starting to matter in production — dashboard this to know when a shared asset needs a higher readAuthMaxRefs for exhaustive lookup.

readonly hash: string

readonly cap: number


{ kind: "blob-hash-mismatch"; hash: string; reason: string; }


{ kind: "blob-upload-failed-server"; hash: string; cause: unknown; }


{ kind: "audit-serialization-exhausted"; clientGroupID: string; clientID: string; mutationID: number; mutationName: string; cause: unknown; }

readonly kind: "audit-serialization-exhausted"

Fired when audit-log INSERTs kept hitting UNIQUE (scope, seq) beyond the retry budget. The mutation was NOT persisted and the mutationID was NOT advanced — the client will resend as usual.

readonly clientGroupID: string

readonly clientID: string

readonly mutationID: number

readonly mutationName: string

readonly cause: unknown


{ kind: "audit-onCheckpoint-failed"; scope: string; tileIndex: number; cause: unknown; }

readonly kind: "audit-onCheckpoint-failed"

onCheckpoint threw after mutation tx commit. Fire-and-forget by design.

readonly scope: string

readonly tileIndex: number

readonly cause: unknown


{ kind: "audit-schema-not-ready"; cause: unknown; }

readonly kind: "audit-schema-not-ready"

Startup / first-request assertion caught schema drift.

readonly cause: unknown