Extension pubsub: duplicate messages

We have different messages. One exact example is:

  • target URL: https://api.twitch.tv/extensions/message/[channel_id]
  • JSON POST Request: {‘content_type’: ‘application/json’, ‘message’: ‘{“event”: “newOnlineState”, “data”: {“online”: 1}}’, ‘targets’: [‘broadcast’]}
  • headers: {‘Client-ID’: [client_id], ‘Authorization’: ‘Bearer [token]’}

Do you think it has something to do with the content? I suggest that the content does’nt matter.

The API call on EBS looks so (python):

def Send(self, channelId, event, data, targets = [“broadcast”]):
headers = {
“Client-ID”: CLIENT_ID,
“Authorization”: “Bearer %s” % (self.GenerateJWT(channelId), ),
}
messageData = {‘event’: event, ‘data’: data}
httpData = {“content_type”: “application/json”, “message”: json.dumps(messageData), “targets”: targets}
pubSubURL = “https://api.twitch.tv/extensions/message/%s” % (channelId, )
result = requests.post(pubSubURL, json = httpData, headers=headers)

and the call in the extension is:

window.Twitch.ext.listen(“broadcast”, pubsubMsg);

The pubsubMsg function is called twice, during the Send function on EBS side is called once.