API reference › @evolu/common › local‑first/Protocol › ProtocolMessageRangesMaxSize

const ProtocolMessageRangesMaxSize: between(
  3_000,
  maxProtocolMessageRangesMaxSize,
)(Int);

Defined in: packages/common/src/local-first/Protocol.ts:373

Protocol message ranges maximum size.

Defines the upper limit for how large the ranges section of a protocol message can be. Implementations must enforce a maximum size between 3KB and 100KB to ensure compatibility.

The upper bound is set to ensure ranges fit within the default 1MB defaultProtocolMessageMaxSize, maintaining compatibility between all clients and relays. A received message whose ranges section exceeds twice the upper bound is rejected as ProtocolInvalidDataError.