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

Fix broadcast wrong messages #9

Merged
merged 2 commits into from
Mar 25, 2016

Conversation

thomaschaaf
Copy link
Contributor

The on('message') is fired for every match. We should only broadcast it, if the path and event match.

With DEBUG=* node src/

Before:

feathers-sync:redis emitting event to channel todos patched +2ms
feathers-sync:redis got event "todos patched", calling old emit [object Object] +1ms
feathers-sync:redis got event "todos patched", calling old emit [object Object] +0ms
feathers-sync:redis got event "todos patched", calling old emit [object Object] +0ms
feathers-sync:redis got event "todos patched", calling old emit [object Object] +1ms

After:

feathers-sync:redis emitting event to channel todos patched +3ms
feathers-sync:redis got event "todos patched", calling old emit [object Object] +0ms

The on('message') is fired for every match. We should only broadcast it, if the path and event match.

With DEBUG=* node src/

Before:
```
feathers-sync:redis emitting event to channel todos patched +2ms
  feathers-sync:redis got event "todos patched", calling old emit [object Object] +1ms
  feathers-sync:redis got event "todos patched", calling old emit [object Object] +0ms
  feathers-sync:redis got event "todos patched", calling old emit [object Object] +0ms
  feathers-sync:redis got event "todos patched", calling old emit [object Object] +1ms
```

After:
```
  feathers-sync:redis emitting event to channel todos patched +3ms
  feathers-sync:redis got event "todos patched", calling old emit [object Object] +0ms
```
@daffl daffl merged commit 4877daf into feathersjs-ecosystem:master Mar 25, 2016
@daffl
Copy link
Member

daffl commented Mar 25, 2016

Makes sense, thank you. I'll publish a patch later today.

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.

2 participants