From 799f4736d7fcd1f70db616e04748ffe0cb90285a Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Sat, 11 Jul 2015 18:40:15 -0700 Subject: [PATCH] fix always call onNext use defaultIfEmpty to prevent filtering from collapsing observable pipeline early --- server/boot/fieldGuide.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/boot/fieldGuide.js b/server/boot/fieldGuide.js index c0caf5e9a6..91e6ff927c 100644 --- a/server/boot/fieldGuide.js +++ b/server/boot/fieldGuide.js @@ -41,14 +41,16 @@ module.exports = function(app) { .flatMap(function(user) { debug('saving user'); return saveUser(user); - }); + }) + // always call onNext + .defaultIfEmpty(null); var query = { where: { dashedName: { like: dashedName, options: 'i' } } }; debug('find fieldGuide', query); Rx.Observable.combineLatest( // find that field guide - findOneFieldGuide(query).tap(function() { console.log('foo'); }), + findOneFieldGuide(query), userSave, Rx.helpers.identity )