API reference / @evolu/common / Evolu/Protocol / ProtocolMessageMaxSize

Variable: ProtocolMessageMaxSize

const ProtocolMessageMaxSize: BrandType<
  Type<"Brand", number & Brand<"Int">, number, IntError, number, NumberError>,
  "Between1000000-100000000",
  BetweenError<1000000, 100000000>,
  IntError | NumberError
>;

Defined in: packages/common/src/Evolu/Protocol.ts:270

Protocol message maximum size.

Defines the upper limit for how large a single protocol message can be. Implementations must enforce a maximum size between 1MB and 100MB to ensure compatibility across all Evolu implementations (the maximum size of mutation change is hardcoded and enforced hence the maximum size can't be smaller).

Larger maximum sizes can be configured by relays to reduce roundtrips. For example, a dedicated relay with ample resources could configure a 100MB maximum to minimize roundtrips for large syncs.

Only relays can safely configure larger sizes, as clients will handle them. Increasing this value on the client side would break compatibility with relays that enforce smaller limits.

Was this page helpful?