Repository navigation
Expose participantIdentity on DataReceivedEvent - #1256
Open
xianshijing-lk wants to merge 3 commits into
Open
xianshijing-lk wants to merge 3 commits into
xianshijing-lk wants to merge 3 commits into
Conversation
DataReceivedEvent carries a nullable RemoteParticipant, which is null whenever the sender is not in remoteParticipants - data sent through the Server API, or by a participant that has already left. In that case the receiver had no way at all to tell who sent the data, even though the engine had the identity in hand at the construction site. Add participantIdentity, populated from the data packet for every event. Port of livekit/client-sdk-js#2092. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
xianshijing-lk
requested review from
changt,
cloudwebrtc and
hiroshihorie
as code owners
October 23, 2026 22:28
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A required named parameter breaks existing DataReceivedEvent callers and would make this a major release. The engine is the only producer and always passes the identity, so defaulting it keeps the change additive and the patch bump honest. Matches the Android port. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of livekit/client-sdk-js#2092.
The gap
DataReceivedEvent.participantis nullable, and the field's own comment says why:When it is null — data sent via the Server API, or by a participant who has already left — the receiver has no way to tell who sent the data. The identity is not merely hard to get, it is absent from the event entirely.
The engine has it in hand at the construction site and simply drops it:
The fix
Add a non-nullable
participantIdentitytoDataReceivedEvent, populated from the packet for every event — present whether or not the sender resolves to aRemoteParticipant.Verification
Added
test/core/data_received_identity_test.dart, which delivers an inbound packet from an identity that is not a room participant and asserts the identity still arrives. Before the change it does not compile, because the field does not exist:A second case covers a known participant, so both the resolved and unresolved paths are pinned.
flutter test472/472,flutter analyze lib/clean.API note
This adds a required named parameter to the public
DataReceivedEventconstructor. Nothing outside the SDK should be constructing these — the engine is the only producer — but it is technically breaking for anyone who does (a test fake, say). Happy to make it optional with a default of''instead if you'd prefer to keep the constructor source-compatible.🤖 Generated with Claude Code