Skip to content

Conversation

@Qizot
Copy link

@Qizot Qizot commented Jan 12, 2026

Description

Describe your changes.

Motivation and Context

Why is this change required? What problem does it solve? If it fixes an open
issue, please link to the issue here.

Documentation impact

  • Documentation update required
  • Documentation updated in another PR
  • No documentation update required

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)

@Qizot Qizot changed the title Add support for data channels FCE-2596 Add support for data channels Jan 12, 2026
@linear
Copy link

linear bot commented Jan 12, 2026

@Qizot Qizot requested a review from Copilot January 12, 2026 16:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for data channels to the WebRTC client, enabling bidirectional binary data transmission between peers through reliable and lossy channels.

Changes:

  • Implemented DataChannelManager and DataChannel classes to handle WebRTC data channel lifecycle and messaging
  • Added public APIs (createDataPublishers, publishData, subscribeData) across webrtc-client, ts-client, and react-client packages
  • Created a React chat example application demonstrating data channel usage

Reviewed changes

Copilot reviewed 25 out of 27 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
packages/webrtc-client/src/webRTCEndpoint.ts Added data channel manager integration and public API methods for data publishing
packages/webrtc-client/src/types.ts Defined data channel configuration types, events, and message payload interfaces
packages/webrtc-client/src/logger.ts Added debug logging level
packages/webrtc-client/src/index.ts Exported new data channel types
packages/webrtc-client/src/dataChannels/DataChannelManager.ts Core manager for creating and coordinating reliable/lossy data channels
packages/webrtc-client/src/dataChannels/DataChannel.ts Wrapper class for RTCDataChannel with event handling and type conversion
packages/webrtc-client/src/ConnectionManager.ts Added createDataChannel method
packages/ts-client/src/types.ts Added data publisher configuration and events
packages/ts-client/src/index.ts Exported data channel types
packages/ts-client/src/FishjamClient.ts Integrated data publisher methods and event forwarding
packages/react-client/src/types/public.ts Defined React hook return type for data publisher
packages/react-client/src/index.ts Exported data publisher hook and types
packages/react-client/src/hooks/useDataPublisher.ts React hook for data channel operations
packages/react-client/src/FishjamProvider.tsx Added dataPublisher prop
packages/react-client/.tool-versions Fixed Node.js version format
examples/react-client/chat/* Complete chat application demonstrating data channels

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Qizot Qizot requested review from Karolk99 and Copilot January 13, 2026 11:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 32 out of 34 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Karolk99 Karolk99 requested a review from czerwiukk January 15, 2026 13:16
@Qizot Qizot requested a review from czerwiukk January 19, 2026 11:16
const client = fishjamClientRef.current;
const [isConnected, setIsConnected] = useState(false);
const [ready, setReady] = useState(false);
const [loading, setLoading] = useState(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: do we need the loading state? isn't it implied that (!ready && !error) === loading?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you don't call initialize then you have both !ready and !error which is not necessairly loading.

@Qizot Qizot requested a review from czerwiukk January 19, 2026 12:06
@Qizot Qizot marked this pull request as ready for review January 19, 2026 13:50
@Qizot Qizot requested a review from Copilot January 19, 2026 13:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 30 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@czerwiukk czerwiukk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regarding the code - it's fine for me, but i'd change the name of the feature to useDataChannel, also it'd be good to add a js hook to the room explaining that the messages are going to be published to the room the peer is currently connected to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants