You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add ConnectOptions.dataStream with maxPayloadByteLength
The Rust core has always accepted a payload cap — it is the guard against
a sender making a receiver allocate arbitrary memory, including via a
compressed stream that inflates far past its wire size — but nothing
exposed it, so `null` was hardcoded and every room ran with the core's
5 GB default.
Placed on `ConnectOptions` rather than `RoomOptions`, which is where
Swift puts it. It fits the lifecycle better here: the incoming manager is
created lazily on the first inbound packet precisely so a connect-time
value is in effect by the time it is read. Worth knowing it diverges from
Swift if cross-SDK consistency matters more than that.
Also enforced on web, which otherwise would have accepted the option and
silently done nothing with it — the same trap as the ignored
`connect(roomOptions:)` argument. The Dart path tracks accumulated
content bytes per stream so an unknown-length stream is capped too, not
just one that declares an oversized `totalLength`.
Both paths follow the core's semantics, which are subtler than they look:
the stream-opened event fires *before* the cap is applied, so the topic
handler still runs and it is the reader that fails with
`LengthExceeded`. A consumer is told the stream died rather than watching
it never arrive. My first pass had web refusing the stream outright and
the doc comment describing that; both are corrected here.
0 commit comments