Skip to main content
Version: Current

PatchMessage

@rotorsoft/act-root


@rotorsoft/act-root / act-http/src/sse / PatchMessage

Type Alias: PatchMessage<S>

PatchMessage<S> = Record<number, DeepPartial<S>> & object

Defined in: libs/act-http/src/sse/types.ts:30

SSE message: version-keyed domain patches. Keys are stringified version numbers, values are domain patches (deep partials). Multi-event commits produce multiple version-keyed entries.

The optional _overlay marker flags a version-neutral update (presence, computed-field refresh) emitted by BroadcastChannel.overlay — a single entry keyed at the current version. It tells applyPatchMessage to merge the entry on top of the client's caught-up state instead of rejecting it as stale (a same-version patch WITHOUT the marker stays stale). Ordinary version-bumping patches from publish() omit it.

_resync carries no versions at all. The server emits it when it cannot construct a patch: when overlay-contributed state is lost, because overlay() finds no cached baseline or the LRU evicts an entry that carried overlay keys. A client that receives one always reports behind and refetches, so live subscribers don't silently miss updates.

Type Parameters​

S​

S extends BroadcastState = BroadcastState

Type Declaration​

_overlay?​

readonly optional _overlay?: true

_resync?​

readonly optional _resync?: true