Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web-chat): peer connected counter #266

Merged
merged 2 commits into from
Sep 5, 2023
Merged

fix(web-chat): peer connected counter #266

merged 2 commits into from
Sep 5, 2023

Conversation

danisharora099
Copy link
Contributor

@danisharora099 danisharora099 commented Sep 4, 2023

This PR attempts to fix the peers connected counter mismatch identified in #264

  • checks connected peers for protocols instead of protocol.peers() which returns peers in the peer store
  • adds a peer:disconnect handler to remove disconnected peers

Notes

@danisharora099 danisharora099 requested a review from a team as a code owner September 4, 2023 13:02
storePeers: peers
.filter((p) => p.protocols.includes(waku.StoreCodec))
.map((p) => p.id),
//TODO: use from import
Copy link
Contributor Author

Choose a reason for hiding this comment

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

to be addressed with waku-org/js-waku#1532

@danisharora099 danisharora099 merged commit b688b42 into master Sep 5, 2023
8 checks passed
@danisharora099 danisharora099 deleted the fix/counter branch September 5, 2023 10:06
//TODO: use from import
filterPeers: peers
.filter((p) =>
p.protocols.includes("/vac/waku/filter-subscribe/2.0.0-beta1")
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not using waku.filter.getPeers ? @danisharora099

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fryorcraken
do you mean peers? it returns the peers that exist in the peer store for that protocol, and not the peers necessarily we're connected to at the time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could possible have a method on the BaseProtocol to fetch connected peers for that protocol

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.

3 participants