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 (60)
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
✔️ 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
✔️ 97209eb #9 2025-10-27 14:06:11 ~4 min linux/status-go 📦zip
✔️ 97209eb #9 2025-10-27 14:08:20 ~6 min macos/status-go 📦zip
✔️ 97209eb #9 2025-10-27 14:11:17 ~9 min windows/status-go 📦zip
✔️ 97209eb #9 2025-10-27 14:14:25 ~12 min linux/nwaku 📦zip
✖️ 97209eb #10 2025-10-27 14:14:56 ~12 min tests-rpc 📄log
✔️ 97209eb #10 2025-10-27 14:30:51 ~28 min tests 📄log
✔️ b75bfac #10 2025-10-29 08:44:47 ~3 min macos/status-go 📦zip
✔️ b75bfac #10 2025-10-29 08:45:03 ~4 min linux/status-go 📦zip
✔️ b75bfac #10 2025-10-29 08:49:16 ~8 min windows/status-go 📦zip
✔️ b75bfac #10 2025-10-29 08:52:28 ~11 min linux/nwaku 📦zip
✔️ b75bfac #11 2025-10-29 08:53:49 ~12 min tests-rpc 📄log
✔️ b75bfac #11 2025-10-29 09:08:50 ~27 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ b3304bb #11 2025-10-29 09:02:19 ~3 min macos/status-go 📦zip
✔️ b3304bb #11 2025-10-29 09:02:23 ~3 min linux/status-go 📦zip
✔️ b3304bb #11 2025-10-29 09:09:14 ~10 min windows/status-go 📦zip
✔️ b3304bb #11 2025-10-29 09:10:30 ~12 min linux/nwaku 📦zip
✔️ b3304bb #12 2025-10-29 09:10:34 ~11 min tests-rpc 📄log
✔️ b3304bb #12 2025-10-29 09:37:00 ~27 min tests 📄log
✔️ 970afcf #12 2025-10-29 09:24:36 ~3 min macos/status-go 📦zip
✔️ 970afcf #12 2025-10-29 09:24:55 ~4 min linux/status-go 📦zip
✔️ 970afcf #12 2025-10-29 09:29:46 ~8 min windows/status-go 📦zip
✔️ 970afcf #13 2025-10-29 09:31:52 ~10 min tests-rpc 📄log
✔️ 970afcf #12 2025-10-29 09:32:16 ~11 min linux/nwaku 📦zip
✔️ 970afcf #13 2025-10-29 10:04:40 ~27 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.65%. Comparing base (70ee5da) to head (970afcf).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
services/connector/api.go 80.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6973      +/-   ##
===========================================
- Coverage    59.69%   59.65%   -0.04%     
===========================================
  Files          804      805       +1     
  Lines       114143   114177      +34     
===========================================
- Hits         68137    68117      -20     
- Misses       39019    39046      +27     
- Partials      6987     7014      +27     
Flag Coverage Δ
functional 35.66% <60.00%> (-0.02%) ⬇️
unit 55.25% <91.42%> (-0.04%) ⬇️

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%> (ø)
services/connector/commands/chain_id.go 60.86% <100.00%> (ø)
services/connector/commands/client_handler.go 78.98% <100.00%> (+0.13%) ⬆️
services/connector/commands/request_accounts.go 82.85% <100.00%> (+1.03%) ⬆️
services/connector/commands/revoke_permissions.go 75.00% <100.00%> (+1.08%) ⬆️
services/connector/commands/rpc_traits.go 76.92% <ø> (ø)
services/connector/commands/send_transaction.go 49.35% <100.00%> (+0.66%) ⬆️
services/connector/commands/sign.go 76.92% <100.00%> (+0.45%) ⬆️
...rvices/connector/commands/switch_ethereum_chain.go 71.18% <100.00%> (ø)
services/connector/commands/test_helpers.go 100.00% <100.00%> (ø)
... and 5 more

... and 30 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 2 times, most recently 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
@friofry friofry force-pushed the ab/issue-6972-connector-client-id branch 2 times, most recently from b75bfac to b3304bb Compare October 29, 2025 08:58
@friofry friofry force-pushed the ab/issue-6972-connector-client-id branch from b3304bb to 970afcf Compare October 29, 2025 09:20
@friofry friofry merged commit 611cc60 into develop Oct 29, 2025
21 checks passed
@friofry friofry deleted the ab/issue-6972-connector-client-id branch October 29, 2025 10:14
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