-
Notifications
You must be signed in to change notification settings - Fork 739
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: relayer would only connect if there are topics present in the cl… #5654
Conversation
@@ -268,6 +272,13 @@ export class Relayer extends IRelayer { | |||
} | |||
|
|||
async transportOpen(relayUrl?: string) { | |||
if (!this.subscriber.hasAnyTopics) { | |||
this.logger.warn( | |||
"Starting WS connection skipped because the client has no topics to work with.", |
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.
should this be warn
level or debug
?
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.
it should be an error and the call should be rejected technically but we want to avoid breaking changes. Warn specifies something is not behaving as expected and I think it fits best. Debug will rarely be used by devs as its quite noisy
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.
got it. So we don't want folks to interact with this API? Can we test on AppKit just to make sure we don't get loads of warnings now unexpectedly?
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 - can you link me to the release process please? I suggest we test it in the lab
the release checklist |
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.
LGTM let's make sure to do some thorough testing on AppKit and on the sample app
…etConnect/walletconnect-monorepo into fix/ws-connection-to-respect-topics
Description
Implemented two changes based on https://www.notion.so/walletconnect/Core-SDK-Relay-reconnects-optimisation-1903a661771e80cebb47ccfae9fd905f
transportOpen
will only open ws connection if there are topics for the client to subscribeType of change
How has this been tested?
tests
Checklist
Additional Information (Optional)
Please include any additional information that may be useful for the reviewer.