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:31

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 โ€” today, when overlay() finds the stream's baseline evicted from the LRU. A client that receives one always reports behind and refetches. Without it the server had nothing to say in that case, so live subscribers silently stopped receiving presence updates and had no way to notice (#1423).

Type Declarationโ€‹

_overlay?โ€‹

readonly optional _overlay?: true

_resync?โ€‹

readonly optional _resync?: true

Type Parametersโ€‹

Sโ€‹

S extends BroadcastState = BroadcastState