Skip to content

fix(siwx): preserve unrelated local storage sessions on delete - #5737

Open
grandpig wants to merge 1 commit into
reown-com:mainfrom
grandpig:main
Open

fix(siwx): preserve unrelated local storage sessions on delete#5737
grandpig wants to merge 1 commit into
reown-com:mainfrom
grandpig:main

Conversation

@grandpig

@grandpig grandpig commented Aug 3, 2026

Copy link
Copy Markdown

Description

Fix LocalStorage.delete() in the SIWX package so that it only removes sessions matching both the requested chain ID and account address.

The existing filter uses:

session.data.chainId !== chainId &&
  session.data.accountAddress !== address

This unintentionally removes unrelated sessions when either the chain ID or account address matches.
For example, deleting (eip155:1, 0xAAA) also removes:

(eip155:1, 0xBBB)
(eip155:137, 0xAAA)

The filter now uses ||, preserving every session except those matching both identifiers.

Regression coverage verifies that:

  • the matching chain and address session is removed;
  • a session with the same chain and a different address is preserved;
  • a session with a different chain and the same address is preserved;
  • a session with a different chain and address is preserved;
  • duplicate sessions matching both identifiers are all removed.

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)

Associated Issues

N/A — small, self-contained bug fix.

Showcase (Optional)

N/A — no UI changes.

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

Signed-off-by: grandpig <grandpig@outlook.com>
@changeset-bot

changeset-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 76019e0

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

This PR includes changesets to release 26 packages
Name Type
@reown/appkit-siwx Patch
@reown/appkit Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-ton Patch
@reown/appkit-adapter-tron Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-common Patch
@reown/appkit-universal-connector Patch
@reown/appkit-ui Patch
@reown/appkit-controllers Patch
@reown/appkit-core Patch
@reown/appkit-utils Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-polyfills Patch
@reown/appkit-wallet Patch
@reown/appkit-siwe Patch
@reown/appkit-wallet-button Patch
@reown/appkit-cdn Patch
@reown/appkit-experimental Patch
@reown/appkit-testing Patch
@reown/appkit-cli Patch
@reown/appkit-pay Patch
@reown/appkit-codemod 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

@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

@grandpig is attempting to deploy a commit to the Reown Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CTA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@grandpig

grandpig commented Aug 4, 2026

Copy link
Copy Markdown
Author

I have read the CTA Document and I hereby sign the CTA

@grandpig

grandpig commented Aug 4, 2026

Copy link
Copy Markdown
Author

@hilljessica8787-dot Thank you for your approval. Signed.

@grandpig

grandpig commented Aug 4, 2026

Copy link
Copy Markdown
Author

It seems that the CI failure is unrelated to this change

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.

2 participants