-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add support for multiple sessions #135
Add support for multiple sessions #135
Conversation
This commit introduces support for multiple sessions via Wallet Connect client, enabling developers to manage various accountIds simultaneously. Redundant functions have been removed for cleaner code. Signed-off-by: Fran Fernandez <fran@kabila.app>
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 to me!
} | ||
} | ||
|
||
private async checkPersistedState() { |
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.
My review doesn't account for removing checkPersistedState or pingWithRetry. I don't think I'm qualified to review if these can be removed :)
|
||
if (existingSessions.length) { | ||
await this.onSessionConnected(existingSessions.pop()!) | ||
const existingSessions = this.walletConnectClient.session.getAll() |
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.
Could you please explain a bit why the logic for checking really alive sessions has been removed and simplified to this one?
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.
This function was designed to remove sessions when the corresponding wallet in the communication fails to respond. Non-responsiveness can occur if the wallet is closed or temporarily inaccessible; however, it is crucial that the session remains valid during such intervals. The getAll method from WalletConnect core is tasked with reinstating any session that should remain active, ensuring continuity and stability in the communication process.
Signed-off-by: Fran Fernandez <fran@kabila.app>
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
Nice work! |
This commit introduces support for multiple sessions via Wallet Connect client, enabling developers to manage various accountIds simultaneously.
Redundant functions have been removed for cleaner code.
Notes for reviewer:
This pull request is part of PR#76, which will be permanently deleted once all topics are split.
Checklist