-
Notifications
You must be signed in to change notification settings - Fork 42
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
feat: add custom events to Relay #1213
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I only wonder if we should use CustomEvents
from libp2p or have our own. The event does not seem libp2p related so just wonder if we are restricting ourselves here.
Not really, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good bug I wonder if it's good enough for @therealjmj. We might need a dump function too.
size-limit report 📦
|
Funny, in making 'observers' private, it's likely this broke our implementation. |
@therealjmj I can followup with a "dump" function but isn't it enough to have these two events for you to track what happens to |
I'm really not a fan of events and listener/subscriber models - it'll add tech that needs to be tested and maintained on our end. However... I would love a "dump" function to make it much easier on us! |
Ok :) Adding dump function soon upd: added here #1249 |
Problem
There was a report that
Relay.observers
were not properly cleaned up and it was hard to debug in a runtime so some hack was introduced on the consumer side.Solution
Add
observer:added
andobserver:removed
to track state of the internalobservers
structure.Notes
Validation