Skip to content

Commit

Permalink
Fix sync after following a feed you already have partial state for
Browse files Browse the repository at this point in the history
  • Loading branch information
arj03 committed Oct 24, 2020
1 parent d51092d commit beef15f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions feed-syncer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ module.exports = function (partial, contacts) {
pull.values(graph.following),
pull.asyncMap((feed, cb) => {
if (!partialState[feed] || !partialState[feed]['full']) {

// we might already have partial state about the feed,
// so when we do a full sync we need to clear the state
delete SSB.state.feeds[feed]

pull(
rpc.partialReplication.getFeed({ id: feed, seq: 0, keys: false }),
pull.asyncMap(SSB.db.validateAndAdd),
Expand Down

0 comments on commit beef15f

Please sign in to comment.