feathers-reactive
feathers-reactive copied to clipboard
inconsistent handling of undefined vs non-existent query properties
Due to serialization the query { } is equivalent to { prop: undefined } in terms of the returned results (at least over the wire).
Unfortunately, siftjs handles both cases differently which can lead to an event unexpectedly not matching the initial query:
const sift = require('sift');
console.log(sift({})({ prop: 'someid' })); // true
console.log(sift({ prop: undefined })({ prop: 'someid' })); // false
One q'n'd way to solve this would be stringifying and reparsing the query before passing it to sift. Maybe it's even the best way to ensure client/server consistency.