feathersjs-ecosystem / feathers-sync

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

[MongoDB] Writing event fails when the hook context contains a query with a key starting with `$` #83

Closed claustres closed 6 years ago

claustres commented 6 years ago

Steps to reproduce

Performs a patch/update operation on a service with any common query operators like e.g. $in.

Actual behavior

The patched/updated event is not raised.

mubsub publish operation fails with the following error: key $select must not start with '$'. Indeed for now the whole hook context object is serialized in the DB with e.g. the connection, the user, the access token, etc.

No error is raised in Feathers.

Expected behavior

The patched/updated event is raised.

Not sure which part of the hook context is required to be written in the event but probably not everything.

Feathers should catch error from the mubsub module using callbacks and at least display a message.

System configuration

NodeJS version: 8.9

Operating System: Windows 10

Module: 1.0.2

daffl commented 6 years ago

Allright, just released v1.0.3 that should fix the issue (at least the test for it). Thank you for digging into this, made it a fairly easy fix (#85)!