mycognosist / solar

A minimal Secure Scuttlebutt replication node.
Other
20 stars 2 forks source link

Introduce live message sending for EBT sessions #92

Closed mycognosist closed 5 months ago

mycognosist commented 5 months ago

While testing EBT I noticed that Manyverse sends messages of interest to active session peers immediately, instead of sending a partial vector clock indicating the update. This PR introduces that same behaviour to solar.

An event is emitted when the local key-value store is updated with a new message. The event includes the feed ID and the sequence number of the appended message. Those details are matched on in the EBT manager. If we have an active session with a peer interested in receiving messages from that feed, we send the message (as long as the sequence number is greater than the sequence number in the latest vector clock from that peer).

Live updates are now bidirectional when an EBT session is active between solar and Manyverse, as well as between two instances of solar.