Skip to content
Playground(another site)

bynk.ws.route_param_mismatch

Error A WebSocket on message/on close route parameter does not match the on open parameter at the same position — route values are recovered positionally from the connection, so they must be a type-compatible prefix of the on open parameters (real-time track slice 3b-iii).

on message and on close are not given a fresh URL: their route values are recovered, in order, from what on open accepted. So the leading parameters of each must have the same types as on open's, in the same order. A different type at some position would reinterpret one route value as another. Match the types of on open's parameters; the names may differ. A missing frame parameter is bynk.ws.message_frame_param.

Example

on open (room: RoomId) -> Effect[()] by user: Member { … }
on close (who: UserId) -> Effect[()] by user: Member { … } // ✗ the first route value is a `RoomId`
on open (room: RoomId) -> Effect[()] by user: Member { … }
on close (room: RoomId) -> Effect[()] by user: Member { … } // ✓ same leading types

In the Book

See also

  • Every code in its category, Other, on the diagnostic index.
  • bynk explain bynk.ws.route_param_mismatch shows the same from the installed toolchain, without a network.