Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#9408 closed defect (fixed)

subscription to channel denied - incorrectly handled

Reported by: Prutkar Owned by: Greg Wilkins
Priority: high Milestone: 1.7
Component: DojoX Cometd Version: 1.3.1
Keywords: subscription denied Cc:
Blocked By: Blocking:

Description

Server: Jetty 6.1.17
Client: Dojo 1.3.1

Code:

dojox.cometd.subscribe("/chat/room, this, "_chat", {user: "User"});

Response from server: Subscription request rejected

Expected behavior: Callback function "_chat" will be called containing message "error":"403::cannot subscribe"... (or is this incorrect expectation?)

Description of failure: Legitimate rejection of subscription request to the channel by the server, dojo code goes into reconnect/handshake procedure. Callback function "_chat" is never being called, user can not be notified of his subscription failure. (seems like dojo is executing code which handles detection of lost connection)

FireBug? logs start.

Post 1:
[{"user":"User"},"channel":"/meta/subscribe","subscription":"/chat/room","clientId"
:"v5kwsj263bzhkank7i","id":"6","timestamp":"Mon, 15 Jun 2009 04:00:13 GMT"}]

Response 1:
[{"id":"6","error":"403::cannot subscribe","subscription":"/chat/room","successful":false,"channel":"
/meta/subscribe"}]


Post 2:
[{"channel":"/meta/connect","connectionType":"long-polling","clientId":"z3kzkjps8c4na28qba","id":"6"
,"timestamp":"Mon, 15 Jun 2009 04:10:00 GMT"}]

Response 2:
empty


Post 2:
[{"channel":"/meta/disconnect","clientId":"z3kzkjps8c4na28qba","id":"7","timestamp":"Mon, 15 Jun 2009
 04:10:00 GMT"}]

Response 2:
[{"id":"7","successful":true,"channel":"/meta/disconnect"}]


Error: xhr cancelled dojoType=cancel message=xhr cancelled


Post 3:
[{"channel":"/meta/connect","connectionType":"long-polling","clientId":"z3kzkjps8c4na28qba","id":"8"
,"timestamp":"Mon, 15 Jun 2009 04:10:11 GMT"}]

Response 3:
[{"error":"402::Unknown client","successful":false,"advice":{"reconnect":"handshake","interval":500}
,"channel":"/meta/connect"}]


Post 4:
[{"version":"1.0","minimumVersion":"0.9","channel":"/meta/handshake","id":"9","supportedConnectionTypes"
:["long-polling","long-polling-json-encoded","callback-polling"],"timestamp":"Mon, 15 Jun 2009 04:10
:12 GMT","ext":{"ack":true}}]

Response 4:
[{"id":"9","minimumVersion":"0.9","supportedConnectionTypes":["long-polling","callback-polling"],"successful"
:true,"advice":{"reconnect":"retry","interval":0,"timeout":300000},"channel":"/meta/handshake","clientId"
:"15040cwziju9yukl847","version":"1.0"}]


Post 5:
[{"channel":"/meta/connect","clientId":"15040cwziju9yukl847","connectionType":"long-polling","id":"10"
,"timestamp":"Mon, 15 Jun 2009 04:10:12 GMT"}]

Response 5:
[{"id":"10","successful":true,"advice":{"reconnect":"retry","interval":0,"timeout":300000},"channel"
:"/meta/connect"}]


Post 6:
[{"channel":"/meta/connect","connectionType":"long-polling","clientId":"15040cwziju9yukl847","id":"11"
,"timestamp":"Mon, 15 Jun 2009 04:10:12 GMT"}]

FireBug? logs end.

Note: In case there is channel reconnect procedure inserted into the reconnect/re-handshake procedure (taken from examples), this is going to loop with no end. Like this code:

this._meta = dojo.subscribe("/cometd/meta", this, function (e) {
	if (e.action == "handshake") {
		if (e.reestablish) {
			if (e.successful) {
				dojox.cometd.startBatch();
				dojox.cometd.subscribe("/chat/room", bc_chat, "_chat", {
					user: chatter.username_local_present,
				});
				dojox.cometd.publish("/chat/room", {
					join: true,
					user: "User",
					});
				dojox.cometd.endBatch();
			}
		}
	}

Change History (4)

comment:1 Changed 10 years ago by dante

Milestone: tbdfuture

comment:2 Changed 9 years ago by Chris Mitchell

Resolution: wontfix

closing as wontfix, as cometd client is now maintained at cometd.org. query will be sent to cometd team/Simone Bordet for review by cometd project leads

comment:3 Changed 9 years ago by dylan

Resolution: wontfixfixed
Status: newclosed

This appears to work with the cometd hosted version of the client. If not, please file a ticket with the cometd project.

comment:4 Changed 9 years ago by bill

Milestone: future1.7
Note: See TracTickets for help on using tickets.