Skip to content

Add DataChannelRpcConnectionClosed (1506) RPC error code - #1973

Merged
1egoman merged 1 commit into
mainfrom
rpc-connection-closed-error-code
Nov 15, 2026
Merged

1egoman merged 1 commit into
mainfrom
rpc-connection-closed-error-code

Conversation

@1egoman

@1egoman 1egoman commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the built-in data channel RPC error code DataChannelRpcConnectionClosed = 1506, message "Connection closed", to utils/data_channel_rpc.go.

The client SDKs recently added this code. A pending performRpc call fails with it when the caller's own room disconnects mid-call. That keeps it separate from RecipientDisconnected (1503), which means the remote participant left.

I compared the full code list against both SDKs. 1506 is the only one missing here; every other code and message already matches.

Change

  • Add DataChannelRpcConnectionClosed to the 1500 + iota block (so it's 1506) and its message to dataChannelRpcErrorMessages.
  • Map it to psrpc.Unavailable in PsrpcError(), the same as RecipientDisconnected. Without a case it would fall through to Internal.

Checked locally: the constant is 1506, Error() gives RpcError 1506: Connection closed, and PsrpcError().Code() is unavailable.

🤖 Generated with Claude Code

Mirrors CONNECTION_CLOSED from the JS SDK (livekit/client-sdk-js#2251) and
ConnectionClosed from the Rust SDK (livekit/rust-sdks#1671): a call fails
with it when the caller's own room disconnects while the call is in flight.
@changeset-bot

changeset-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5e8c041

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@livekit/protocol Patch
github.com/livekit/protocol Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@1egoman
1egoman merged commit f66646a into main Nov 15, 2026
13 checks passed
@1egoman
1egoman deleted the rpc-connection-closed-error-code branch November 15, 2026 20:14
@github-actions github-actions Bot mentioned this pull request Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants