#14651·onyx

Add connector: timeout does not delete a connector created without a credential

Author: jmelahmanCreated Sep 11, 2026Updated Sep 11, 2026
Labelsbug

Problem

In web/src/app/admin/connectors/[connector]/AddConnectorPage.tsx, the add-connector form races connector creation against a 10 second timeout (CONNECTOR_CREATION_TIMEOUT_MS). When the timeout wins, the form shows the timeout toast and calls deleteConnector(connectorIdRef.current) to remove the partly created connector.

connectorIdRef is set from response?.id, where response is the JSON that submitConnector returns. The frontend types it as Connector<T>, but the backend does not send that shape on every path:

Path Backend response response.id
POST /manage/admin/connector (with credential) ObjectCreationIdResponse (id, credential) connector id
POST /manage/admin/connector-with-mock-credential (no credential) StatusResponse (success, message, data) undefined

On the mock-credential path, connectorIdRef is never set. If the request takes longer than 10 seconds, the user sees the timeout error, but the connector and its connector-credential pair stay. The backend also starts indexing for them (CHECK_FOR_INDEXING).

Note: StatusResponse.data on this path is the connector-credential pair id (association.id in add_credential_to_connector), not the connector id. A fix cannot use data with deleteConnector as is.

Steps to reproduce

  1. Open the add-connector page for a source that uses the mock credential (no credential step).
  2. Make the backend call take more than 10 seconds, for example with a slow connector validation.
  3. Submit the form.

Expected: the timeout toast shows, and the connector is deleted. Actual: the timeout toast shows, and the connector stays and starts to index.

Related

  • submitConnector returns response?: Connector<T>. Type it as the real response union, so that the compiler shows this case.
  • Found while typing JSON responses for the type coverage work (#14650).