Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

> **Note:** Versions 0.3.26 – 0.3.55 were released as git tags without changelog entries. Changelog resumes at 0.3.56 below.

## 0.5.6

### Fixed

- **Apply 1s stale-prior threshold to `_createPeer` path.** v0.5.5
lowered the threshold to 1s in the inbound-connection handler but
left the `_createPeer` path on the old `_heartbeatInterval` (10s).
When both sides of a peer pair dialled each other in rapid
succession, the inbound handler accepted with the 1s rule but the
merged `_createPeer` re-evaluated with 10s and could pick the
opposite winner. Mac-side and Node-side then kept different
connections, each killing the other's choice — visible in field
testing as a continuous ~6s join → disconnect cycle even after
v0.5.5. Aligned both sites on 1s.

## 0.5.5

### Fixed
Expand Down
9 changes: 8 additions & 1 deletion lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1208,8 +1208,15 @@ class SymNode extends EventEmitter {
// nodeId acts as client and keeps outbound; higher keeps inbound
const existingTransport = existingPeer.transports.get(source);
const staleByFlag = !existingTransport || existingTransport._closed;
// Match the inbound-connection handler (v0.5.5): a 1s threshold catches
// peer process restarts (kill + quick re-dial) without rejecting
// genuine dual-dial collisions, which fire <100ms apart. The previous
// _heartbeatInterval (10s) caused dedup-decisions to diverge across
// SDKs — Node-side rejected as stale while sym-swift kept the prior,
// so the surviving connection on one side was already dead on the
// other and the peer flapped continuously.
const staleByLastSeen = existingPeer.lastSeen
&& (Date.now() - existingPeer.lastSeen) > this._heartbeatInterval;
&& (Date.now() - existingPeer.lastSeen) > 1000;
const stalePrior = staleByFlag || staleByLastSeen;
if (existingTransport && !stalePrior) {
const prevIsOutbound = !!existingPeer.isOutbound;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sym-bot/sym",
"version": "0.5.5",
"version": "0.5.6",
"description": "Infrastructure and protocol for multi-agent collective intelligence",
"main": "lib/node.js",
"bin": {
Expand Down