Skip to content

fix(network): expire stale and unreachable peers from the network participant list - #72

Merged
libersoft-org merged 219 commits into
mainfrom
fix/442-prune-stale-discovered-peers
Aug 22, 2026
Merged

fix(network): expire stale and unreachable peers from the network participant list#72
libersoft-org merged 219 commits into
mainfrom
fix/442-prune-stale-discovered-peers

Conversation

@lukyrys

@lukyrys lukyrys commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

The network participant list (Settings → LISH network → Participants) kept showing peers that went offline long ago, and the backend kept re-dialing them forever. This makes those entries expire, and fixes the surrounding lifecycle and cleanup paths the work uncovered.

  • a discovered peer is aged from its last successful contact, not from its last update, so repeated gossip and its own failed dials no longer keep a dead row alive; rows expire 30 minutes after that, scoped per network, and are capped at 256 per network
  • a peer is only evicted from the peer store on real dial failures against addresses this host could route to — losing our own route no longer counts as the peer being dead — and an evicted peer is briefly quarantined so gossip cannot instantly re-add it
  • configured bootstrap peers are never evicted, and only a dial-verified identity gets into the autodial list or exempts a row from expiry
  • leaving a network now finishes even when one peer teardown fails, drops that network's bootstrap addresses, keeps peers shared with another network connected, and no longer reports participants for a network this node is not in
  • network start/stop and enable/disable are serialised and bound to the run they began in, a failed stop is reported instead of being treated as a stopped node, and pending work is drained before shutdown
  • peer announce never advertises an address belonging to another identity, bounds the input before parsing, caps addresses per message, and rate limits intake per source
  • a factory reset treats a missing prepare step as a failed barrier instead of a passed one, so a category is only wiped once the node is proven stopped; categories are independent and on-disk files are never touched
  • one downloader throwing during a leave no longer aborts the downloaders after it, and a download sourced from another joined network keeps running
  • self-addresses are recognised by their destination identity, so a relayed entry naming this node only as the relay hop is no longer discarded
  • frontend: factory reset surfaces which step failed (three new translation keys), no other UI changes

lukyrys added 23 commits July 23, 2026 08:23
@lukyrys
lukyrys marked this pull request as ready for review July 27, 2026 20:05
@lukyrys
lukyrys changed the base branch from main to fix/428-leave-network-disconnect August 11, 2026 08:29
…ale-discovered-peers

# Conflicts:
#	backend/src/protocol/network.ts
lukyrys added 29 commits August 19, 2026 23:54
@libersoft-org
libersoft-org merged commit 7fa9131 into main Aug 22, 2026
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.

2 participants