Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion rivetkit-typescript/packages/rivetkit/src/actor/conn-drivers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,19 @@ export interface ConnDriver<State> {
const WEBSOCKET_DRIVER: ConnDriver<ConnDriverWebSocketState> = {
sendMessage: (
actor: AnyActorInstance,
_conn: AnyConn,
conn: AnyConn,
state: ConnDriverWebSocketState,
message: CachedSerializer<protocol.ToClient>,
) => {
if (state.websocket.readyState !== ConnReadyState.OPEN) {
actor.rLog.warn({
msg: "attempting to send message to closed websocket, this is likely a bug in RivetKit",
connId: conn.id,
wsReadyState: state.websocket.readyState,
});
return;
}

const serialized = message.serialize(state.encoding);

actor.rLog.debug({
Expand Down
Loading