Skip to content

Fix: Prevent custom connectors from colliding#2117

Open
ecoutier wants to merge 1 commit intothingsboard:masterfrom
wiifor:ecoutier_fix_custom_connectors
Open

Fix: Prevent custom connectors from colliding#2117
ecoutier wants to merge 1 commit intothingsboard:masterfrom
wiifor:ecoutier_fix_custom_connectors

Conversation

@ecoutier
Copy link
Copy Markdown
Contributor

@ecoutier ecoutier commented Apr 1, 2026

Context

This PR is linked to the feature request I mentioned in the discord server.
When using remote config with multiple custom connectors of the same type, only the last one was ever instantiated. This is because _implemented_connectors was keyed by connector_type, so each new connector of the same type would silently overwrite the previous entry:

self._implemented_connectors[connector_type] = connector_class

I may not have the full context on why it was originally designed this way, happy to get feedback or alternative approaches if there's a reason I'm missing.

Changes

_implemented_connectors is now keyed by connector name instead of connector type, both at registration (_load_connectors) and at lookup (__connect_with_connectors, __init_and_start_regular_connector). Since names are supposedly unique per connector instance, multiple custom connectors of the same type can now coexist.

Impact

This is a workaround pending proper multi-custom-connector support in the UI.
This has worked on my part to be able to have 2 different custom connectors at the same time, with 2 different classes.
Please note that RPC calls have not been tested
Only covers the remote config scenario : for non remote config, it is still possible to have a folder per custom connector.

@github-actions github-actions bot added the core label Apr 1, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 1, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants