[BUG] Pinning a Connect component version still executes the latest shared code
Describe the bug
Passing version to the Connect component APIs does not run that published version (at least for fetching async options with connect API /components/configure). Configure executes the latest shared module instead, so a prop that was remotely configurable on the pinned version is rejected as if you had requested latest.
This is breaking every action that has been "ai optimized" and has async options. Trying to fetch the options by passing a version from before this update fails. For 2 examples:
- Jira: remove dynamic props from create-issue and update-issue
jira-create-issue0.2.1andjira-update-issue0.3.1loadedcloudIdthrough the apppropDefinition, which has async options.1.0.0replaces that with a plain string incomponents/jira/actions/common/issue.mjs. The app-levelcloudIdpropDefinition was left unchanged. - SharePoint: AI-optimize list-item actions
sharepoint-create-item0.0.17andsharepoint-update-item0.0.17usedreloadPropsandadditionalProps.1.0.0replaces those with a staticfieldsobject.
The Connect API documents version as the semantic version to retrieve or configure, defaulting to latest only when it is omitted. A published version should keep the props it was published with.
To Reproduce
Here's a reproduction with Jira create issue, using SDK @pipedream/sdk 3.1.6 and sending version in the configure body, which matches the configure component prop API.
- Retrieve the last good version:
GET /v1/connect/{project_id}/components/jira-update-issue?version=0.3.1
x-pd-environment: developmentcloudId is still a remote-options prop on this response.
- Configure that same prop on that same version:
POST /v1/connect/{project_id}/components/configure
x-pd-environment: development
{
"id": "jira-update-issue",
"version": "0.3.1",
"external_user_id": "<external user id>",
"prop_name": "cloudId",
"configured_props": {
"jira": {
"authProvisionId": "<connected jira account id>"
}
}
}- The call returns HTTP 200 with:
{
"errors": [
"{\"code\":\"UserError\",\"message\":\"should not be remotely configuring prop: cloudId\"}"
]
}That error is the runtime check for a prop with no async options. It is the 1.0.0 shape of cloudId, not the 0.3.1 shape. The same request with version omitted, or with version: "1.0.0", is expected to fail this way. 0.3.1 is not. The same pin fails for the other three actions above, and any others in a similar situation.
Expected behavior
version: "0.3.1" runs the component that was published as 0.3.1, including the shared file it imported at publish time. Configure cloudId returns the Jira cloud sites for the connected account.
version: "1.0.0" and an omitted version keep the new static props. Older published versions stay unchanged.
Additional context
components/jira/actions/update-issue/update-issue.mjs at 0.3.1 imports components/jira/actions/common/issue.mjs, and that shared file is what #21993 changed. Your component guidelines say that updating a file requires bumping every component that imports it. That bump publishes a new version. It should not change what an already published version executes.
Source: PipedreamHQ/pipedream