git ssb

7+

dinoworm 🐛 / patchcore



Commit 613698a4f9211cb8b1e75978401b1edf3831c673

Do not include 'sync' messages in the backlinks filter obs list.

Gordon Martin committed on 11/26/2017, 9:31:05 PM
Parent: b70e39416e0ec7a808742b9841a6cd32d45b3354

Files changed

backlinks/obs_filter.jschanged
backlinks/obs_filter.jsView
@@ -44,14 +44,22 @@
4444 }],
4545 live: true
4646 })
4747
48 + var msgFilter = pull.filter((msg) => {
49 + // We do not include the 'sync' message which indicates that any
50 + // further messages are newly gossiped messages in the list of messages.
51 + if (msg.sync) {
52 + sync.set(true)
53 + return false
54 + } else {
55 + return filterFn(msg)
56 + }
57 + })
58 +
4859 var filteredBacklinks = pull(
4960 msgBacklinks,
50- pull(
51- pull.map(setSyncIfSyncMsg.bind(null, sync),
52- pull.filter(filterFn)
53- ))
61 + msgFilter
5462 )
5563
5664 var backlinksObs = MutantPullReduce(filteredBacklinks, (state, msg) => {
5765 state.push(msg)
@@ -69,12 +77,4 @@
6977 return nest({
7078 "backlinks.filter.obs": (id, filterFn) => pullFilterReduceObs(id, filterFn)
7179 })
7280 }
73-
74-function setSyncIfSyncMsg(syncObs, msg) {
75- if (msg.sync) {
76- syncObs.set(true)
77- }
78-
79- return msg
80-}

Built with git-ssb-web