feathersjs-ecosystem / feathers-sync

Synchronize service events between Feathers application instances
MIT License
222 stars 41 forks source link

Does not send service events to client if service is connected to moongoose #50

Closed travisbmiller closed 6 years ago

travisbmiller commented 7 years ago

Steps to reproduce

Tell us what broke. The more detailed the better.

Feathers-sync does work with a service that is not connected to moongoose Feathers-sync does not work with a service that is connected to moongoose

I will note, both services do send the result back to the client, but the created event is only being pushed out to the service that is not connected to moogoose

 feathers-sync will sync via adapter: mongodb  +0ms
  feathers-sync setting up database mongodb://localhost:27017/sync +2ms
  feathers-sync subscribing to handler todo-mongoose created +27ms
  feathers-sync subscribing to handler todo-mongoose updated +0ms
  feathers-sync subscribing to handler todo-mongoose removed +0ms
  feathers-sync subscribing to handler todo-mongoose patched +0ms
  feathers-sync subscribing to handler todo created +1ms
  feathers-sync subscribing to handler todo updated +0ms
  feathers-sync subscribing to handler todo removed +0ms
  feathers-sync subscribing to handler todo patched +0ms
  feathers-sync emitting event to channel todo-mongoose created +4s
  feathers-sync emitting event to channel todo created +126ms
  feathers-sync got event, calling old emit todo created +19ms

It shows that it is emitting event for the todo-mongoose (service that is connected to mongoose) but client does not receive event, but client does receive the event for the channel todo created event.

https://github.com/travisbmiller/feathers-sync-test

Expected behavior

Should send all service events to client

Actual behavior

Does not send service any events to client for a service that is connected to mongoose

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working): "feathers": "^2.0.3", "feathers-hooks": "^1.7.1", "feathers-mongoose": "^3.6.1", "feathers-rest": "^1.5.2", "feathers-socketio": "^1.4.2", "feathers-sync": "^0.1.2", "mongoose": "^4.7.5"

NodeJS version: 6.9.1

Operating System: Mac Os 10.12.2 / and Tested on AWS

Browser Version: Chrome / Safari / firefox

daffl commented 7 years ago

That is very strange, I wonder if there is something in the Mongoose adapter that does something feathers-sync doesn't like. I'll check out the repository to see if there is a quick fix we can do otherwise I'll have to revisit it with a refactoring for this repository I'm planning for after the Auk release.

travisbmiller commented 7 years ago

That would be great, I would love to be able to use this.

kc-dot-io commented 7 years ago

@travisbmiller are you able to try the redis adapter to see if it's still working? If so, that might be a work around for now and we'll know if it's isolated to the mongo adapter.

travisbmiller commented 7 years ago

Hey @slajax, Sorry for the so late reply. I have not been able to try to Redis adapter. Do you know if anything has changed with this issue?

kc-dot-io commented 7 years ago

@travisbmiller no idea, but feathers-sync is on my todo list here soon for a new project actually. I'll be using redis (it's better) but I'll test this against mongo too and let you know what I find. I'm pretty conifdent redis should be stable and have no issues if you want to use it. It was stable when I added it atleast - check commit log and roll back / npm link if you have to get unblocked before I get to this.

kc-dot-io commented 7 years ago

It could realistically be an issue at the service level with mongoose as David said, so I would try different adapters for sync and services to try rule out one side or the other.

travisbmiller commented 7 years ago

@slajax that would be awesome! thanks for much. I will try a different adapter as well.

daffl commented 6 years ago

I did a brief test and I think this is fixed with the latest version 🎉