feat: Add WCv2 session amount limit#27988
Conversation
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Why these tags:
Why not other tags: The change is isolated to WalletConnect session lifecycle management and doesn't touch account management (SmokeAccounts), identity/sync (SmokeIdentity), trading (SmokeTrade), ramps (SmokeRamps), card (SmokeCard), perps (SmokePerps), predictions (SmokePredictions), snaps (FlaskBuildTests), or wallet platform features (SmokeWalletPlatform). Risk level: Medium - the change is well-tested with unit tests, has a high limit (20 sessions) that is unlikely to be hit in normal E2E test scenarios, but it modifies the session proposal flow which is critical for dApp connectivity. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|



Description
Enforces the previously defined
LIMIT_SESSIONSlimit for WCv2 connections. When this limit (20 connections) is exceeded, the oldest connection is dropped.Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/WAPI-1356
Manual testing steps
Screenshots/Recordings
Before
After
Screen.Recording.2026-03-26.at.11.58.43.AM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Adds automatic disconnection of an existing WalletConnect v2 session when new approvals push the active session count over a configured limit, which could unexpectedly drop a user’s oldest connection. Logic is small and covered by unit tests, but it affects live connection management.
Overview
Enforces a WalletConnect v2 session cap. After approving a new session,
WC2Managernow callsenforceSessionLimit()to ensure active sessions stay underAppConstants.WALLET_CONNECT.LIMIT_SESSIONSby disconnecting the oldest session (based on smallestexpiry).Adds test coverage for the new behavior, including cases where the limit is exceeded (oldest session is disconnected) and where the session count is at/under the limit (no disconnections).
Written by Cursor Bugbot for commit bf6c451. This will update automatically on new commits. Configure here.