Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

presence module for aedes #69

Merged
merged 4 commits into from
Oct 2, 2016
Merged

presence module for aedes #69

merged 4 commits into from
Oct 2, 2016

Conversation

GavinDmello
Copy link
Collaborator

An online/offline feature for aedes

@coveralls
Copy link

coveralls commented Sep 30, 2016

Coverage Status

Coverage increased (+0.005%) to 97.036% when pulling 77b6655 on GavinDmello:master into 1e74434 on mcollina:master.

t.ok(client, 'client must be passed to published method')

cb()
if (packet.topic.split('/').pop() !== 'clientDisconnect') {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case was failing because the client object was made null after Aedes publish. Let me know if you have a better way of going about this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. but we should put a note here, and maybe in the docs too. For server publishes the client is always null.

Copy link
Collaborator Author

@GavinDmello GavinDmello Oct 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its already mentioned in the published method block in the readme. I'll add it here though.

Copy link
Collaborator

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Some nits to be fixed

@@ -223,6 +223,7 @@ var publishFuncsQoS = [
callPublished
]
Aedes.prototype.publish = function (packet, client, done) {
//console.log(packet, client, done)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please remove this?

this.publish({
topic: '$SYS/' + this.id + '/new/clientDisconnect',
payload: new Buffer(client.id, 'utf8')
}, noop)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be named differently. Would you mind checking what's the situation in Mosquitto and Mosca?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mosquitto doesn't provide this infomation. It provides the number of connected/disconnected clients. Mosca uses $SYS/+/new/clients & $SYS/+/disconnect/clients for connections & disconnections.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the same as mosca then :)

t.ok(client, 'client must be passed to published method')

cb()
if (packet.topic.split('/').pop() !== 'clientDisconnect') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. but we should put a note here, and maybe in the docs too. For server publishes the client is always null.

@coveralls
Copy link

coveralls commented Oct 1, 2016

Coverage Status

Coverage increased (+0.005%) to 97.036% when pulling c2d6f91 on GavinDmello:master into 1e74434 on mcollina:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 97.036% when pulling aaad438 on GavinDmello:master into 1e74434 on mcollina:master.

1 similar comment
@coveralls
Copy link

coveralls commented Oct 1, 2016

Coverage Status

Coverage increased (+0.005%) to 97.036% when pulling aaad438 on GavinDmello:master into 1e74434 on mcollina:master.

@GavinDmello
Copy link
Collaborator Author

Would this require a change in the Readme ?

@mcollina
Copy link
Collaborator

mcollina commented Oct 1, 2016

Yes, please.

@coveralls
Copy link

coveralls commented Oct 1, 2016

Coverage Status

Coverage increased (+0.005%) to 97.036% when pulling 41e781e on GavinDmello:master into 1e74434 on mcollina:master.

@GavinDmello
Copy link
Collaborator Author

Done.

@mcollina
Copy link
Collaborator

mcollina commented Oct 2, 2016

Good Job.

@mcollina mcollina merged commit f801f7c into moscajs:master Oct 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants