This message was deleted.
# helpdesk
s
This message was deleted.
b
When participant is
nil
, it means the data was sent using a Server SDK: SendData
b
Interesting, it seems like the Go SDK never adds the participant, even when using as a client.
😮 1
b
cc @dry-elephant-14928
b
Ill try debugging this a bit more
Hey @dry-elephant-14928, not sure if you've ran into this issue, but I cannot seem to be able to receive a participant ID from the Go SDK
Okay, Sorry, the onDataReceived finally works in Go. Sorry, this was my bad.
From what I understand and getting is on the Client SDK.. if using GO as Client SDK and it executes a
LocalParticipant.PublishData
then on the JS Client SDK, I'm never receiving the Participant data
@dry-elephant-14928 could you tell me, Is that expected?
d
hmm that's not expected.
client sdks should behave the same.. it's possible it's a bug with go sdk during publishing
b
Okay, I wasn't going crazy then ahah Thanks @dry-elephant-14928
@dry-elephant-14928 Finally I found the issue. And its coming from the JS Client Side... In my case, the
participant
is a hidden participant and at this specific line https://github.com/livekit/client-sdk-js/blob/a1b34d2af7b7e101041b37a9154663a0210c8cfe/src/room/Room.ts#L990, well the system can't find the actual participant, so it returns
undefined
. Not sure of the proper fix though.
I'm wondering if we could maybe have something such as:
Copy code
const participant = !userPacket.participantSid
  ? undefined
  : this.participants.get(userPacket.participantSid) 
      ?? this.createParticipant(userPacket.participantSid);
Or something.
For the time being, this works for me, and I get the participant obj. 🙂 Although my only concern is maybe you guys were only doing the get, to make sure the participant actually exists. 🤷‍♂️
d
@brief-refrigerator-69901 I think this is the right behavior.. if the publisher is hidden, then we can't really attribute any participant to it. Actually this seems to be a side effect. it's debatable whether a hidden participant should be able to publish data to others. We currently do not prevent it; but it seems that the behavior is kind of confusing.
b
For me, this is a server state participant, hence the hidden, but this one pushes Data to all or specific participants.