1

there is WAMP - The Web Application Messaging Protocol (https_github.com/tavendo/WAMP/blob/master/spec/basic.md)

for back-end I use https_github.com/voryx/Thruway

for a front http_autobahn.ws/js/

OS - Ubuntu 12 without GUI set up by vagrant

there is - PHP 5.5.9-1 and composer for it.

I'm trying to use standart functionality of Subscribing and Unsubscribing I get "Unsubscribe ERROR" when trying to perform Unsubscribe

My subscribing is looks like:

this.subscribe = function(r,clientId){
        if (!chat.searchSub("loc.wampchat.room.message." + self.room_id)) {
            chat.transport.session.subscribe('loc.wampchat.room.message.' + self.room_id, function (args, kwargs, details) {
                self.addMessage(kwargs.message, kwargs.author_id, kwargs.create_time);
            }).done(function(subscription){
                self.subscriber['loc.wampchat.room.message.' + self.room_id] = subscription;
            });
        }
        if (!chat.searchSub("loc.wampchat.join.room." + self.room_id)) {
            chat.transport.session.subscribe('loc.wampchat.join.room.' + self.room_id, function (args, kwargs, details) {
                self.addUser(chat.connections[kwargs.user_id].user);
                if(kwargs.user_id == clientId){
                    r.add(clientId);
                }
            }).done(function(subscription){
                self.subscriber['loc.wampchat.join.room.' + self.room_id] = subscription;             
            });                
        }
        if (!chat.searchSub("loc.wampchat.leave.room." + self.room_id)) {
            chat.transport.session.subscribe('loc.wampchat.leave.room.' + self.room_id, function (args, kwargs, details) {
                self.deleteUser(kwargs.user_id);
            }).done(function(subscription){
                self.subscriber['loc.wampchat.leave.room.' + self.room_id] = subscription;
            });
        }
    };

the final topic ("loc.wampchat.room.message." + self.room_id) looks like "loc.wampchat.room.message.1125"

Its strange error because it's appears only for topic loc.wampchat.room.message.... and for all other topics (which are almost the same) all good!

Unsubscribing looks like:

for(var key in self.subscriber){
        chat.transport.session.unsubscribe(self.subscriber[key]);
    }
chat.transport.session - it's a simple global object where WAMP session is stored   

Here what console (in browser, Chrome-latest) shows to me:

1. WebSocket transport receive
    [8,34,6196960130236416,{},"wamp.error.no_such_subscription"]



 2. (autobahn.js:791) failing transport due to protocol violation:
    UNSUBSCRIBE-ERROR received for non-pending request ID
    6196960130236416



 3. (autobahn.js:4480) Uncaught InvalidAccessError: Failed to execute
    'close' on 'WebSocket': The code must be either 1000, or between
    3000 and 4999. 1002 is neither.     
        (autobahn.js:3010) transport.close      
        (autobahn.js:3129) self._protocol_violation  
        (autobahn.js:3648) self._process_UNSUBSCRIBE_ERROR  
        (autobahn.js:4451) self._socket.onmessage   websocket.onmessage

And the main misunderstanding that when this error appears server no react at all - simply continue to work! I do not see any problems in server log.

So the main question is : how critical is this error? Can I just forgot about it and continue my work or I MUST somehow fix it?

mbonneau
  • 627
  • 3
  • 8
Sergey
  • 11
  • 1
  • To debug this, set `AUTOBAHN_DEBUG = true;` in your browser client and attach the complete message log. Or paste it as a Gist on Github and link here. – oberstet Jan 31 '15 at 10:36
  • All debug already set to 'true' AUTOBAHN_DEBUG = true; WEB_SOCKET_DEBUG = true; what else can I do? – Sergey Feb 04 '15 at 13:16
  • Sorry, what I meant is enable AUTOBAHN_DEBUG, and then attach the _complete_ message log here (or post it somewhere). This is needed to track down this error (it might be that Thruway does something unexpected). You might also ping the Thruway devs about this. AutobahnJS bails out because it receives a reply of a request it never sent. – oberstet Feb 16 '15 at 19:16
  • Hi Sergey, I have tried to reproduce the problem. Do you know what version of Thruway you are using? Do you have any output from the router console? – mbonneau Mar 05 '15 at 16:14

0 Answers0