These docs are for v0.0.1. Click to read the latest docs for v1.0.61.

Discussions

Ask a Question
Back to All

onParticipantsAdded Workspaces event not working as documented

I am trying to track the participants via a workspaces widget, and I am subscribing to the onParticipantsAdded event, but I am not getting any data in the payload element of the event message and the event message comes in at times that no participant has been added or removed.

I am using react-redux, this is the subscription request:

export function subscribeToParticipantsAdded(callback) {
  console.log('In subscribeToParticipantsAdded()');
  widgetAPI.onDataEvent('onParticipantsAdded', callback);
}

This is the dispatch code in the useEffect block that subscribes when the form is loaded:

subscribeToParticipantsAdded(data => {
        dispatch(newParticipantAdded(data));
      });

This is the event reducer:

reducers: {
    newParticipantAdded: (state, action) => {
      console.log('New participant added, action = ' + JSON.stringify(action, null, 2));
    },

This is what is logged to the javascript console:

bundle.js:2 New participant added, action = {
  "type": "iniAgentService/newParticipantAdded",
  "payload": []
}