pubnub/pubnub-api — Issue #72: PubNub receiving same notification twice
Author: neilgupta
Created: 2012-03-03 01:51:26+00:00
State: open

I am using PubNub to send notifications from my server to my web app. However, in some cases, I am getting the same notification twice at sporadic time intervals (sometimes after a couple minutes, sometimes after 30 minutes, sometimes never). I checked the PubNub History queue, and each notification only shows up once, so I know my server is not sending it multiple times. I also double checked that the client is only connected to each channel just once.

My JS code related to PubNub:

```
var pubnubCallback = function (data) {
ta.vars.$window.trigger("hb-"+data.action, [data, data.channel]);
ta.logger.debug("got pubnub call: ");
ta.logger.debug(data);
};

// loop through list of unique channels to connect to
$.each(channels, function(index, channel) {
PUBNUB.subscribe({
channel : channel,
callback : pubnubCallback,
connect : function() {
ta.logger.debug("connected to "+channel);
},
reconnect: function() {
ta.logger.debug("reconnected to "+channel);
}
});
});
```

Am I missing something in my code, or is there an issue in the PubNub backend that causes it to send the same notification multiple times?