Skip to content

chore(connect-popup): remove unused selectWalletConnectAppPermissions selector - #27838

Merged
mroz22 merged 1 commit into
developfrom
mroz22/dead-code-connect-popup
May 17, 2026
Merged

chore(connect-popup): remove unused selectWalletConnectAppPermissions selector#27838
mroz22 merged 1 commit into
developfrom
mroz22/dead-code-connect-popup

Conversation

@mroz22

@mroz22 mroz22 commented May 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the unused selectWalletConnectAppPermissions selector from @suite-common/connect-popup. Confirmed no callers across the monorepo.

Split out from the staging dead-code PR #27551 (suite-common/* batch).

Related PRs

Sibling PRs in this batch (each removes one piece of dead code from suite-common/*):

Parent staging PR: #27551

Test plan

  • CI typecheck and tests pass

🤖 LLM Test Recommendations

Summary: The change is isolated to connectPopupReducer.ts, which manages TrezorConnect popup state (permissions, silent mode, popup lifecycle). This file maps to 121 tests via transitive imports, but the vast majority are unrelated to connect popup functionality — they simply import it as part of the broader Redux store. The highest risk is in TrezorConnect popup/permissions tests that directly exercise popup state transitions. The recommended strategy focuses on the 4 high-priority tests that directly validate popup permissions, lifecycle, and silent mode, plus 6 medium-priority tests covering other TrezorConnect API flows that go through the permissions modal.

Changed files (1)
  • suite-common/connect-popup/src/connectPopupReducer.ts

Recommended tests (10)

🔴 High priority (4)
  • suite/e2e/tests/trezor-connect/connectPopupWeb.test.ts — The connectPopupReducer is the core state management for the TrezorConnect popup flow. This test directly exercises the popup lifecycle (open, close, permissions, cancellation) which is the primary functionality managed by connectPopupReducer.
  • suite/e2e/tests/trezor-connect/connectPopupWebextension.test.ts — This test exercises the same TrezorConnect popup permission and lifecycle flows as the web variant but through a webextension context. Changes to connectPopupReducer directly affect popup state transitions tested here (permissions modal, cancellation, recovery after force-close).
  • suite/e2e/tests/trezor-connect/permissions.test.ts — This test directly validates granting, remembering, and forgetting TrezorConnect app permissions — state that is explicitly managed by connectPopupReducer (connectPopup.permissions). Changes to the reducer could break permission persistence and revocation flows.
  • suite/e2e/tests/trezor-connect/silentMode.test.ts — This test explicitly asserts on Redux state at connectPopup.permissions[0].silentMode, directly validating state managed by connectPopupReducer. It also tests the permissions modal remember/silent-mode checkbox interactions that the reducer handles.
🟡 Medium priority (6)
  • suite/e2e/tests/trezor-connect/getAddress.test.ts — This test exercises the connect permissions modal and address confirmation flow that goes through the connect popup state. The loading header text and permission granting are managed by popup state from connectPopupReducer.
  • suite/e2e/tests/trezor-connect/getAccountInfo.test.ts — This test exercises the connect permissions modal (confirmButton text, permission granting) which relies on state managed by connectPopupReducer. A regression in popup state could break the account selection flow.
  • suite/e2e/tests/trezor-connect/ethereumSignMessage.test.ts — This test uses connectPermissionsModal to confirm permissions before signing, which depends on connect popup state management. Changes to the reducer could affect the permission confirmation flow.
  • suite/e2e/tests/trezor-connect/ethereumSignTransaction.test.ts — This test confirms connect permissions via the modal and then proceeds through device confirmation steps. The permissions modal state is driven by connectPopupReducer.
  • suite/e2e/tests/trezor-connect/signTransaction.test.ts — This test confirms connect permissions and proceeds through device confirmation prompts. The permission confirmation flow depends on connectPopupReducer state management.
  • suite/e2e/tests/trezor-connect/error.test.ts — This test validates error display in the connect popup (@connect-popup-error/message) when an invalid path is provided. The error state rendering may depend on connectPopupReducer state.

Updated: 2026-05-17T06:44:07.561Z

🔍 Currents Test Results

🔍 Suite desktop test results: View in Currents

🔍 Suite web test results: View in Currents

🔍 Suite native android test results: View in Currents

🔒 Quarantined E2E Tests

Trezor Suite (web) — 4 test(s)
Test Type
Quarantine test: "Onboarding - create wallet,Success (basic)" 🙋 manual
Quarantine test: "Database migration,Db migration between: release/22.5/web => develop/web" 🙋 manual
Quarantine test: "Multiple sessions,Session overtaken by another" 🙋 manual
Quarantine test: "Recovery T2T1 - dry run,Recovery after partial recovery" 🙋 manual

Updated: 2026-05-17T06:48:36.788Z • 4 test(s) total

Trezor Suite (desktop) — 2 test(s)
Test Type
Onboarding - create wallet > Success (basic) 🤖 auto
Quarantine test: "Multiple sessions,Session overtaken by another" 🙋 manual

Updated: 2026-05-17T06:47:30.011Z • 2 test(s) total

🌐 Preview deployments

🌐 Suite Web preview: https://dev.suite.sldev.cz/suite-web/mroz22/dead-code-connect-popup/web/

… selector

(cherry picked from commit b7d21287f0bb7b40b4d0aa22437a136727b978ca)
!!origin &&
state.connectPopup.permissions.some(p => p.origin === origin && p.silentMode === true);

export const selectWalletConnectAppPermissions = (state: ConnectPopupStateRootState) =>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@copilot why is this unused? do you see any opportunity to use this code? is there a duplicit inline implementation maybe?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It’s unused because there are currently zero call sites for selectWalletConnectAppPermissions in the monorepo (rg selectWalletConnectAppPermissions returns none). I also checked for inline duplicates of the same filter (permissions.filter(... type === CALL_SOURCE_WALLETCONNECT)) and found none.

Current WalletConnect handling in this module checks source.type on the active call (e.g. in thunk/modal code), not a selector over remembered permissions, so there isn’t an obvious place to reuse this selector right now. This is why I removed it in 8eed517.

Copilot finished work on behalf of mroz22 May 17, 2026 11:47
@mroz22
mroz22 requested a review from martykan May 17, 2026 12:33
@mroz22
mroz22 marked this pull request as ready for review May 17, 2026 12:33
@mroz22
mroz22 merged commit 785156c into develop May 17, 2026
60 of 63 checks passed
@mroz22
mroz22 deleted the mroz22/dead-code-connect-popup branch May 17, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code Code improvements no-project This label is used to specify that PR doesn't need to be added to a project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants