Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ module.exports = {

// If already _setup, just add this single service.
if (this._setup) {
protoService.setup(this, location);
// If we're using a socket provider, register the service on it.
if (this.addService) {
this.addService(protoService, location);
}
protoService.setup(this, location);
}

this.services[location] = protoService;
Expand Down
1 change: 0 additions & 1 deletion lib/providers/socket/commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ exports.addService = function addService(service, path){
}, this);

// Setup events for the service.
eventsMixin.applyEvents.call(service);
exports.setupEventHandlers.call(this, service, path);
};

Expand Down
11 changes: 3 additions & 8 deletions test/providers/primus.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ describe('Primus provider', function () {
return callback(null, data);
}

callback();
callback(null, false);
};

socket.send('todo::remove', 1, {}, function() {});
Expand Down Expand Up @@ -432,21 +432,16 @@ describe('Primus provider', function () {
return callback(null, data);
}

callback();
callback(null, false);
};

socket.send('tasks::remove', 1, {}, function() {});
socket.send('tasks::remove', 23, {}, function() {});

var ready = false;

socket.on('tasks removed', function (data) {
service.removed = oldRemoved;
assert.equal(data.id, 23);
if (ready) {
done();
}
ready = true;
done();
});
});
});
Expand Down
11 changes: 3 additions & 8 deletions test/providers/socketio.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ describe('SocketIO provider', function () {
return callback(null, data);
}

callback();
callback(null, false);
};

socket.emit('todo::remove', 1, {}, function() {});
Expand Down Expand Up @@ -431,21 +431,16 @@ describe('SocketIO provider', function () {
return callback(null, data);
}

callback();
callback(null, false);
};

socket.emit('tasks::remove', 1, {}, function() {});
socket.emit('tasks::remove', 23, {}, function() {});

var ready = false;

socket.on('tasks removed', function (data) {
service.removed = oldRemoved;
assert.equal(data.id, 23);
if (ready) {
done();
}
ready = true;
done();
});
});
});
Expand Down