This message was deleted.
# cloud
s
This message was deleted.
p
hi! do you have a code snippet ? If you send only once, you would only receive it once. I see that you’re using react, can you confirm that the component that sends the message is not rendering multiple times and thus sending the message multiple times?
b
In the code, when a button clicked the below function will be called, and send a data message to a specific user.
The problem is here. The data receiving event will be fired several times. I check the refresh function to check whether it fires several times but looks like it is not. Only the data receiving event fired several times
f
Hi @polite-kilobyte-67570, Can we expect multiple RoomEvent.DataReceived to be triggered for a given event (eg: user joined, user-left, room_end , etc.) trigger (is this behavior to be expect based on trigger event. i.e: some event may trigger one and some may trigger more than one RoomEvent.DataReceived for a given event)? If this is the case, may we know are we able to capture any state of the event, so we can unique identify what to call in desired event > state.
p
@boundless-jackal-7234 can you verify that you attach the listener only once? I haven’t seen data received being triggered more than once before
@faint-army-19363 I’m not sure I follow. what are you trying to achieve?
f
@polite-kilobyte-67570 once of scenario we have is we need to sync host player (ideo playback) state to other users. I such case say for eg: host click pause in player, in such case we use livekit data channel to notify other users that the player have been pause and based on that pause event data (eg: video pause min:sec , etc.) system trigger same state in player viewing user side. What we observe : So as for above scenario, when we host side pause is triggered, system send data to other users (via livekit data channel). In msg receiving side (viewer), once the data is received, RoomEvent.DataReceived seems to called multiple times for the data sent.
p
are you two working on the same app or are these completely different issues?
f
Same app
p
to investigate this we would need a minimal reproduction that we can run which showcases the bug. In our examples RoomEvent.DataReceived is only triggered once for each message sent
f
Noted with thanks. Will share and confirm