Skip to content

0.5.6: align _createPeer stale threshold with inbound handler (1s)#25

Merged
sym-bot merged 1 commit into
mainfrom
release/0.5.6
Apr 30, 2026
Merged

0.5.6: align _createPeer stale threshold with inbound handler (1s)#25
sym-bot merged 1 commit into
mainfrom
release/0.5.6

Conversation

@sym-bot
Copy link
Copy Markdown
Owner

@sym-bot sym-bot commented Apr 30, 2026

Why

v0.5.5 lowered the stale-prior 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 dial each other in rapid succession, the inbound handler accepts with the 1s rule but the merged _createPeer re-evaluates with 10s and can pick the opposite winner. Mac-side and Node-side then keep different connections, each killing the other's choice — visible in field testing as a continuous ~6s join → disconnect cycle even after v0.5.5.

What

Aligned both stale-detection sites on a hardcoded 1s threshold.

Tests

  • 150 existing tests pass

v0.5.5 lowered the stale-prior threshold to 1s in the inbound-connection
handler but left the _createPeer path on the old _heartbeatInterval (10s).
When both sides dialled each other in rapid succession, the two paths
could pick opposite winners — Mac-side and Node-side kept different
connections, each killing the other's choice. Field testing showed a
continuous ~6s join → disconnect cycle persisting after v0.5.5.

Aligned both stale-detection sites on 1s.
@sym-bot sym-bot merged commit e899c9c into main Apr 30, 2026
2 checks passed
@sym-bot sym-bot deleted the release/0.5.6 branch April 30, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant