feathers-reactive icon indicating copy to clipboard operation
feathers-reactive copied to clipboard

inconsistent handling of undefined vs non-existent query properties

Open j2L4e opened this issue 7 years ago • 0 comments

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.

j2L4e avatar Jun 28 '18 11:06 j2L4e