-
Notifications
You must be signed in to change notification settings - Fork 168
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
Added new willReconnect
method to Client and Server delegates
#125
Added new willReconnect
method to Client and Server delegates
#125
Conversation
…makes it possible for API users to track the actual connection status of each session.
sorry, this has merge conflicts now |
Solved! :) |
Sources/PublicInterface/Client.swift
Outdated
@@ -10,6 +10,12 @@ public protocol ClientDelegate: AnyObject { | |||
func client(_ client: Client, didConnect session: Session) | |||
func client(_ client: Client, didDisconnect session: Session) | |||
func client(_ client: Client, didUpdate session: Session) | |||
func client(_ client: Client, willReconnect session: Session) |
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.
do you want to move it to a separate Client2Delegate?
I don't remember the specifics (why I didn't go for the change to the ClientDelegate + default implementation), but the reason was to not break any source code that would update the library version.
I'll double check this anyway during review.
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's a possibility too, I didn't have the latest changes when coding this new method. Although from a pure aesthetics point of view I kinda like it better in the original delegate protocol 😀 Up to you, 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.
Ok, I have checked out the branch in my main project, and the build fails because my existing class does not conform to protocol ServerDelegate
now.
Please move this method to the Client2Delegate
protocol, and the same for the ServerDelegate
- to the ServerDelegateV2
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.
Ok, done!
c4eec9f
to
08326c9
Compare
With this new delegate method it should be possible for API users to track the actual connection status of each session. This is helpful when you'd want your UI to reflect whenever a session has lost its connection and thus wallet connect events won't work until it's been reconnected.
It'd work like this: