ssbc / ssb-friends

Manages the SSB social graph
MIT License
23 stars 6 forks source link

race condition `sbot.friends.stream` #37

Closed mixmix closed 5 years ago

mixmix commented 5 years ago

Because of https://github.com/ssbc/ssb-friends/issues/34 , I'm still using the legacy API sbot.friends.stream in patchbay to figure out relationships between people.

I've noticed (in the past month perhaps) that there's an apparent race condition, where sometimes the first item out of the stream is the initial state object, as expected (in which case everything works), and sometimes it's an empty object {}.

I've spent an hour trying to debug this, reading : patchcore, ssb-friends, layered-graph. I've dived deep enough and hit code I don't understand without loading even more context. It's also hard because I think this API should be deprecared