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

refactor: disable disconnected call for siwe if not connected #2364

Merged

Conversation

enesozturk
Copy link
Contributor

@enesozturk enesozturk commented Jun 5, 2024

Changes

When we not connected, we are still calling the client's disconnect function and if the SIWE enabled, this causing unnecessary async function and this causing the modal to be closed with a promise delay.

Also considered

We could do optimistic updates and directly close the modal and make the signOut calls on the background. While this might sound good, might cause some issues for certain situations

Copy link

vercel bot commented Jun 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
web3modal-gallery ✅ Ready (Inspect) Visit Preview Jun 6, 2024 1:15pm
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Jun 6, 2024 1:15pm

Copy link
Member

@chris13524 chris13524 left a comment

Choose a reason for hiding this comment

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

Test case?

Copy link
Collaborator

@tomiir tomiir left a comment

Choose a reason for hiding this comment

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

Looks good but a test would be nice 🙏

@enesozturk
Copy link
Contributor Author

Looks good but a test would be nice 🙏

This is something that could be tested with integration tests, not E2E because it's a decision when to trigger SIWE actions rather than any affect to how they are working. And this change is just effecting the modal when it's in disconnected state.

If we decide to test these kind of details, it'll bring too much workload to our E2E tests which their right place is integration tests. Maybe we could consider having them with Jest rather than Playwright

@enesozturk enesozturk merged commit 42420a5 into V4 Jun 6, 2024
9 checks passed
@enesozturk enesozturk deleted the refactor/remove-disconnect-call-on-siwe-if-not-connected branch June 6, 2024 14:16
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.

4 participants