Opened 12 years ago

Closed 12 years ago

#3317 closed defect (fixed)

Comet listeners are not removed when the connection is closed

Reported by: guest Owned by: alex
Priority: high Milestone: 0.9beta
Component: Dojox Version: 0.9
Keywords: comet, cometd, publish, connect Cc:
Blocked By: Blocking:

Description

When a script invokes cometd subscribe, a listener is added for this channel in dojo. However these listener are not invalidated when the server closes the connection. This causes the handlers called multiple times on reconnect.

I am not sure if it is the really intended behaviour.

Step to reproduce : function connect() {

dojox.cometd.init(null, "/comet/cometd"); dojox.cometd.subscribe("/messages", null, function(obj) {console.debug("Message from the server :", obj);}

}

function disconnect() {

dojox.cometd.disconnect();

}

function publish() {

request = {message:"New message"}; dojox.cometd.publish("/messages", request);

}

connect(); disconnect(); connect(); publish();

The publish will fire the handler twice.

Change History (2)

comment:1 Changed 12 years ago by Tom Trenka

Owner: changed from Tom Trenka to alex
severity: majornormal

comment:2 Changed 12 years ago by alex

Resolution: fixed
Status: newclosed

(In [9410]) ensuring that disconnect cleans out subscriptions and backlogs. Fixes #3317

Note: See TracTickets for help on using tickets.