Commit a959612185d373132b8891bcf18328d98c8a6bc0
fix feed.pull.channel index selection
see ssbc/patchwork#556Matt McKegg committed on 6/14/2017, 5:06:03 AM
Parent: 97c748723f07a39c9848a6539e7c3de0c58d2462
Files changed
feed/pull/channel.js | changed |
feed/pull/channel.js | ||
---|---|---|
@@ -10,18 +10,22 @@ | ||
10 | 10 … | return nest('feed.pull.channel', function (channel) { |
11 | 11 … | if (typeof channel !== 'string') throw new Error('a channel name be specified') |
12 | 12 … | |
13 | 13 … | return function (opts) { |
14 | - var filter = {dest: `#${channel}`} | |
15 | - | |
16 | - // HACK: handle lt | |
17 | - if (opts.lt != null) { | |
18 | - filter.timestamp = {$lt: opts.lt, $gte: 0} | |
19 | - delete opts.lt | |
14 … | + var filter = { | |
15 … | + dest: `#${channel}`, | |
16 … | + timestamp: opts.lt | |
17 … | + ? {$lt: opts.lt, $gt: 0} | |
18 … | + : {$gt: 0} | |
20 | 19 … | } |
21 | 20 … | |
22 | - return api.sbot.pull.backlinks(extend(opts, {query: [ | |
23 | - {$filter: filter} | |
24 | - ]})) | |
21 … | + delete opts.lt | |
22 … | + | |
23 … | + return api.sbot.pull.backlinks(extend(opts, { | |
24 … | + index: 'DTS', // HACK: force index since flumeview-query is choosing the wrong one | |
25 … | + query: [ | |
26 … | + {$filter: filter} | |
27 … | + ] | |
28 … | + })) | |
25 | 29 … | } |
26 | 30 … | }) |
27 | 31 … | } |
Built with git-ssb-web