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

fix: siwe map to siwx onSignOut callback #3316

Merged
merged 13 commits into from
Nov 25, 2024
Merged

fix: siwe map to siwx onSignOut callback #3316

merged 13 commits into from
Nov 25, 2024

Conversation

zoruka
Copy link
Contributor

@zoruka zoruka commented Nov 22, 2024

Description

  • Fix onSignOut not being called for activeCaipAddress changes;
  • Fix signOut/onSignOut not being called on useDisconnect hook calls;
  • Fix AppKitSIWEClient signIn and signOut methods to call new SIWX handlers;
  • Add tests for mapToSIWX function and usage against AppKit.

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

vercel bot commented Nov 22, 2024

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

Name Status Preview Comments Updated (UTC)
appkit-gallery-new ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2024 0:29am
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2024 0:29am
appkit-laboratory-new ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2024 0:29am
appkit-vue-solana ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2024 0:29am
appkit-wagmi-cdn-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2024 0:29am
vue-wagmi-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2024 0:29am

Copy link

changeset-bot bot commented Nov 22, 2024

🦋 Changeset detected

Latest commit: a36a62d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@reown/appkit Patch
@reown/appkit-siwe Patch
@apps/demo Patch
@apps/gallery Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-polkadot Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-utils Patch
@reown/appkit-cdn Patch
@reown/appkit-common Patch
@reown/appkit-core Patch
@reown/appkit-experimental Patch
@reown/appkit-polyfills Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwx Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Nov 22, 2024

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 442.46% 6281 / 34437
🔵 Statements 442.46% 6281 / 34437
🔵 Functions 470.02% 513 / 1850
🔵 Branches 636.47% 965 / 2212
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/src/tests/mocks/Adapter.ts 100% 100% 100% 100%
packages/siwe/src/client.ts 56.71% 60% 37.5% 56.71% 47-48, 54-55, 61-62, 68-71, 74-80, 83-91, 94-103
packages/siwe/src/mapToSIWX.ts 95.51% 90.24% 100% 95.51% 76-77, 141-142, 190-193
Generated in workflow #7589 for commit a36a62d by the Vitest Coverage Report Action

packages/siwe/src/mapToSIWX.ts Show resolved Hide resolved
Comment on lines 58 to 59
const compareSessionAddress = session?.address.toLowerCase()
const compareCaipAddress = CoreHelperUtil?.getPlainAddress(activeCaipAddress)?.toLowerCase()
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: variable names seem off

packages/siwe/src/mapToSIWX.ts Show resolved Hide resolved
Copy link
Collaborator

@Cali93 Cali93 left a comment

Choose a reason for hiding this comment

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

Nice 👌

@zoruka zoruka merged commit 1f586a2 into main Nov 25, 2024
20 checks passed
@zoruka zoruka deleted the fix/siwe-map-to-siwx branch November 25, 2024 12:51
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.

3 participants