Skip to content

Conversation

@friofry
Copy link
Contributor

@friofry friofry commented Oct 1, 2025

fixes #6972
Allow isolated state management per dapp (Dapp browser, chrome extension, wallet-connect)

Database:

  • Added migration to include client_id column with composite PRIMARY KEY (url, client_id). Existing records migrated with client_id = '' for backward compatibility.

API:

  • Added ClientID field to RPCRequest, ConnectorDApp, DApp
  • Updated commands
  • DefaultClientID constant for backward compatibility. Old clients(browser extension) automatically use empty string "".

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds ClientID support to the connector system, enabling isolated state management per DApp client (Dapp browser, Chrome extension, wallet-connect).

Key changes include:

  • Database migration to add client_id column with composite PRIMARY KEY (url, client_id)
  • API updates to include ClientID field in relevant structs and function signatures
  • Backward compatibility support for existing clients using empty string as default client ID

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
walletdatabase/migrations/sql/1759312232_add_client_id_to_connector_dapps.up.sql Migration script to add client_id column and composite primary key
signal/events_connector.go Added ClientID field to ConnectorDApp struct
services/connector/database/persistence.go Updated database operations to use URL+ClientID composite key
services/connector/database/persistence_test.go Added comprehensive tests for multi-client scenarios
services/connector/commands/*.go Updated all command handlers to use ClientID in database operations
services/connector/api.go Modified API methods to accept and use ClientID parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@status-im-auto
Copy link
Member

status-im-auto commented Oct 1, 2025

Jenkins Builds

Click to see older builds (34)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 11f3882 #1 2025-10-01 10:15:23 ~3 min macos/status-go 📦zip
✔️ 11f3882 #1 2025-10-01 10:15:47 ~3 min linux/status-go 📦zip
✔️ 11f3882 #1 2025-10-01 10:19:13 ~6 min windows/status-go 📦zip
✔️ 11f3882 #1 2025-10-01 10:22:27 ~10 min linux/nwaku 📦zip
✔️ 11f3882 #1 2025-10-01 10:22:54 ~10 min tests-rpc 📄log
✔️ 11f3882 #1 2025-10-01 10:38:51 ~26 min tests 📄log
✔️ 6a7f16c #2 2025-10-01 12:43:14 ~3 min macos/status-go 📦zip
✔️ 6a7f16c #2 2025-10-01 12:43:20 ~3 min linux/status-go 📦zip
✔️ 6a7f16c #2 2025-10-01 12:47:44 ~7 min windows/status-go 📦zip
✔️ 6a7f16c #2 2025-10-01 12:49:54 ~9 min linux/nwaku 📦zip
✔️ 6a7f16c #2 2025-10-01 12:57:02 ~16 min tests-rpc 📄log
✖️ 6a7f16c #2 2025-10-01 13:07:21 ~27 min tests 📄log
✔️ 9ceeeea #3 2025-10-06 12:25:45 ~3 min macos/status-go 📦zip
✔️ 9ceeeea #3 2025-10-06 12:26:35 ~4 min linux/status-go 📦zip
✔️ 9ceeeea #3 2025-10-06 12:29:17 ~6 min windows/status-go 📦zip
✔️ 9ceeeea #3 2025-10-06 12:33:01 ~10 min linux/nwaku 📦zip
✔️ 9ceeeea #3 2025-10-06 12:33:26 ~10 min tests-rpc 📄log
✔️ 9ceeeea #3 2025-10-06 12:49:45 ~27 min tests 📄log
✔️ afae65c #4 2025-10-06 15:25:39 ~3 min macos/status-go 📦zip
✔️ afae65c #4 2025-10-06 15:26:18 ~4 min linux/status-go 📦zip
✔️ afae65c #4 2025-10-06 15:28:50 ~6 min windows/status-go 📦zip
✔️ afae65c #4 2025-10-06 15:33:36 ~11 min linux/nwaku 📦zip
✔️ 4b0b6d6 #5 2025-10-06 15:29:36 ~3 min macos/status-go 📦zip
✔️ 4b0b6d6 #5 2025-10-06 15:30:22 ~3 min linux/status-go 📦zip
✔️ 4b0b6d6 #5 2025-10-06 15:35:12 ~6 min windows/status-go 📦zip
✔️ 4b0b6d6 #5 2025-10-06 15:41:19 ~14 min tests-rpc 📄log
✔️ 4b0b6d6 #5 2025-10-06 15:45:15 ~11 min linux/nwaku 📦zip
✔️ 4b0b6d6 #5 2025-10-06 15:59:58 ~33 min tests 📄log
✔️ 5aae232 #6 2025-10-21 14:02:25 ~4 min linux/status-go 📦zip
✔️ 5aae232 #6 2025-10-21 14:03:45 ~5 min macos/status-go 📦zip
✖️ 5aae232 #6 2025-10-21 14:04:11 ~5 min tests 📄log
✔️ 5aae232 #6 2025-10-21 14:05:53 ~7 min windows/status-go 📦zip
✔️ 5aae232 #6 2025-10-21 14:10:04 ~11 min linux/nwaku 📦zip
✖️ 5aae232 #6 2025-10-21 14:10:48 ~12 min tests-rpc 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 171db7e #7 2025-10-21 14:29:13 ~4 min linux/status-go 📦zip
✔️ 171db7e #7 2025-10-21 14:34:13 ~8 min windows/status-go 📦zip
✔️ 171db7e #7 2025-10-21 14:37:11 ~11 min linux/nwaku 📦zip
✖️ 171db7e #7 2025-10-21 14:37:35 ~12 min tests-rpc 📄log
✔️ 171db7e #7 2025-10-21 14:53:53 ~28 min tests 📄log
✔️ 171db7e #7 2025-10-21 14:54:25 ~29 min macos/status-go 📦zip
✖️ 171db7e #8 2025-10-21 15:16:40 ~11 min tests-rpc 📄log
✔️ 07e9e68 #8 2025-10-21 15:45:53 ~3 min linux/status-go 📦zip
✔️ 07e9e68 #8 2025-10-21 15:50:51 ~8 min windows/status-go 📦zip
✔️ 07e9e68 #9 2025-10-21 15:53:41 ~11 min tests-rpc 📄log
✔️ 07e9e68 #8 2025-10-21 15:53:42 ~11 min linux/nwaku 📦zip
✖️ 07e9e68 #8 2025-10-21 16:13:05 ~30 min tests 📄log
✔️ 07e9e68 #8 2025-10-21 16:52:13 ~1 hr 10 min macos/status-go 📦zip
✔️ 07e9e68 #9 2025-10-21 18:01:30 ~28 min tests 📄log

@codecov
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

❌ Patch coverage is 95.71429% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.48%. Comparing base (21a5a1a) to head (07e9e68).

Files with missing lines Patch % Lines
services/connector/api.go 80.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #6973       +/-   ##
============================================
+ Coverage    35.52%   59.48%   +23.95%     
============================================
  Files          782      805       +23     
  Lines       112278   114767     +2489     
============================================
+ Hits         39888    68268    +28380     
+ Misses       67311    39489    -27822     
- Partials      5079     7010     +1931     
Flag Coverage Δ
functional 35.49% <58.57%> (-0.03%) ⬇️
unit 55.00% <91.42%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
services/connector/commands/accounts.go 80.00% <100.00%> (+66.66%) ⬆️
services/connector/commands/chain_id.go 60.86% <100.00%> (+26.08%) ⬆️
services/connector/commands/client_handler.go 78.98% <100.00%> (+43.72%) ⬆️
services/connector/commands/request_accounts.go 82.85% <100.00%> (+19.22%) ⬆️
services/connector/commands/revoke_permissions.go 75.00% <100.00%> (+27.17%) ⬆️
services/connector/commands/rpc_traits.go 76.92% <ø> (+23.07%) ⬆️
services/connector/commands/send_transaction.go 51.94% <100.00%> (+15.10%) ⬆️
services/connector/commands/sign.go 76.92% <100.00%> (+76.92%) ⬆️
...rvices/connector/commands/switch_ethereum_chain.go 71.18% <100.00%> (+20.33%) ⬆️
services/connector/commands/test_helpers.go 100.00% <100.00%> (+100.00%) ⬆️
... and 5 more

... and 496 files with indirect coverage changes

@friofry friofry changed the title feat(connector)_: add ClientId feat(connector): add ClientId Oct 1, 2025
@friofry friofry force-pushed the ab/issue-6972-connector-client-id branch 2 times, most recently from afae65c to 4b0b6d6 Compare October 6, 2025 15:26
@friofry friofry force-pushed the ab/issue-6972-connector-client-id branch from 4b0b6d6 to 5aae232 Compare October 21, 2025 13:58
@friofry friofry force-pushed the ab/issue-6972-connector-client-id branch from 5aae232 to 171db7e Compare October 21, 2025 14:24
@friofry friofry force-pushed the ab/issue-6972-connector-client-id branch from 171db7e to 07e9e68 Compare October 21, 2025 15:41
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.

Connector: add ClientId for independent state management

4 participants