-
-
Notifications
You must be signed in to change notification settings - Fork 506
Conversation
@@ -380,7 +380,7 @@ Server.prototype.publish = function publish(packet, client, callback) { | |||
logger.debug({ packet: newPacket }, "published packet"); | |||
} | |||
that.emit("published", newPacket, client); | |||
callback(); | |||
callback(newPacket); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move this as the second argument? The first one is for the error.
This is missing a unit test. |
Could get test to run on my client. I would put it in tests/server.js after the test "should support subscribing via server.subscribe":
please let me know if I should push this to the PR. |
I would cal it "should provide packet in publish callback". Anyway, yes, Il giorno sab 23 lug 2016 alle 20:06 Thomas Spalinger <
|
Renamed the test in the commit as you supposed. |
Thanks!! |
allows the callback to get the generated message id or any other content.
i.e. usefully for filtering own published message from the published hook.
against the contribution guidelines, could not run tests for this commit. Currently have some problems with other dependencies. Hope this small change didn't break anything. At least could find code that should break with this.