[BUG] Reconnect loads and saves the connection's creation-time piece version, so new OAuth2 scopes never appear
Problem
Reconnect on an OAuth2 connection shows the scope list of the piece version the connection was created with, not the current one. Scopes added in later piece versions never appear (Gmail: gmail.modify, added in piece 0.15.1 / platform 0.91.3; a connection created on 0.88.x is pinned to 0.12.10 with 4 scopes). Reconnect saves the same old pieceVersion, so nothing changes. Only delete + recreate picks up new scopes. Reproduced on 0.91.3; identical code in 0.92.0 and main.
Ref: Pylon 6120
Root cause
app_connection.pieceVersion is written at creation (activepieces/activepieces#10330, since 0.73.0) and never advanced.
packages/web/src/app/connections/reconnect-button-dialog.tsx:32→usePiece({ name, version: connection.pieceVersion })packages/web/src/app/builder/step-settings/piece-settings/connection-select.tsx:68→version: reconnectConnection?.pieceVersion ?? params.piece.versionpackages/web/src/app/connections/create-edit-connection-dialog.tsx→ upsert sendspieceVersion: piece.versionfrom that old modelappConnectionService.upsertstoresparams.pieceVersionas-is and accepts any version, so the server needs no change
Pin exists so refresh/validate load the auth schema at the stored version.
Fix
Frontend only. Reconnect loads the latest piece version when the connection's auth type still exists in the latest auth list (else fall back to stored version); upsert writes the new pieceVersion. Same change in routes/embed/embedded-connection-dialog.tsx.
Steps to reproduce
app_connectionrow:pieceName=@activepieces/piece-gmail,pieceVersion=0.12.10- Connections → Reconnect → Permissions: 4 scopes; request is
GET /v1/pieces/@activepieces/piece-gmail?version=0.12.10 - New Connection → Gmail → Permissions: 5 scopes
Source: activepieces/activepieces