ssbc / ssb-replication-scheduler

Plugin to trigger replication of feeds identified as friendly in the social graph
8 stars 1 forks source link

only fetch MetafeedFinder after disk state loaded #17

Closed staltz closed 1 year ago

staltz commented 1 year ago

Context

Stumbled upon this issue in https://github.com/ssbc/ssb-replication-scheduler/pull/11

Problem

If you call MetafeedFinder fetch before it has loaded state (all the metafeed/announce msgs from the database), then it will ask remote peers for data that is already in our local database

Solution

Queue all fetch calls until the database has loaded all the 'metafeed/announce' messages.

staltz commented 1 year ago

Yeah, lets eventually do something about that pattern. It's so little code right now, that it doesn't look like a technical debt.