socket icon indicating copy to clipboard operation
socket copied to clipboard

Peers join subclusters before being instructed to do so

Open garth opened this issue 1 year ago • 0 comments

If a peer has previously connected to a subcluster, the next time it starts it will re-join the subcluster after 30 seconds even though the application has not yet created the subcluster.

This causes a number of issues. When a peer comes online, other peers in the subcluster are notified and start sending messages, but since that peer has not yet joined the subcluster there are not event handlers configured for those messages. Also when the peer does decide to connect to the subcluster, peers are not notified since the #join event was already sent prematurely.

What OS are you using (uname -a, or Windows version)?

Darwin Garths-MacBook-Pro.local 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64

What version Socket Runtime are you using?

0.5.4 (97fa3f7c)
Installation path: /Users/garth/Projects/socket-editor/node_modules/.pnpm/@[email protected]/node_modules/@socketsupply/socket-darwin-arm64/

I also tried this on the latest master branch but the results are the same.

0.5.4 (ef7fb555)
Installation path: /Users/garth/.local/share/socket/

What programming language are you using (C/C++/Go/Rust)?

node --version
v20.11.0

What did you expect to see and what you saw instead?

I would expect that subcluster peers are only notified of another peer joining when the peer actually connects to the subcluster and is ready to receive messages.

garth avatar Jan 30 '24 11:01 garth