Skip to content

fix: Clear connected peers interval on pause and ensure libp2p doesn't redial after pause - #3385

Open
islathehut wants to merge 6 commits into
developfrom
fix/libp2p-dial-after-pause
Open

fix: Clear connected peers interval on pause and ensure libp2p doesn't redial after pause#3385
islathehut wants to merge 6 commits into
developfrom
fix/libp2p-dial-after-pause

Conversation

@islathehut

@islathehut islathehut commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Checklist

  • I have linked this PR to a related GitHub issue.
  • I have added a description of the change (and Github issue number, if any) to the root CHANGELOG.md.

(Optional) Mobile checklist

Please ensure you completed the following checks if you did any changes to the mobile package:

  • I have run e2e tests for mobile
  • I have updated base screenshots for visual regression tests

@islathehut
islathehut marked this pull request as ready for review July 27, 2026 15:34
@islathehut
islathehut requested a review from adrastaea July 27, 2026 15:47
this.connectedPeers.clear()
// await this.libp2pDatastore?.deleteKeysByPrefix(Libp2pDatastorePrefix.PEERS)
// remove peers from the datastore to avoid libp2p auto-redialing after the pause
await this.libp2pDatastore?.deleteKeysByPrefix(Libp2pDatastorePrefix.PEERS)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently a no-op because peers does not match /peers/, so nothing is deleted. Also, deleting the entire peer namespace will also delete the self records, so that could be detrimental. It would be better to enumerate the peer records and use the .delete() api to clear remote peer records. The test you added just proves that this command is called, not that it actually deleted the records which is why it is passing.

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