Skip to content

SocketIO emit with callback fails while upgrading 0.9.16 to 1.35 #2101

@tonyjose009

Description

@tonyjose009

Hi,

In 0.9.16, I use socket.emit with callback so that the chat server return some data and I can handle the result as per the acknowledgement. But after the upgrade to 1.35 I've found a error in console like this

Uncaught TypeError: Cannot read property 'apply' of undefined.

I've done something like this,

From web

            socket.emit('userToUser', { 'usename': 'John',
                'message': 'hi'
            }, function(callback){
                //callback handled    
            });

Chat Server

    socket.on('userToUser', function(content, callback){
        //do something
        if(callback) return callback({'result':'success', 'messageid':content.messageid,        'chatid':content.chatid});
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions