Skip to content

[ENG-3723] feat: opt-in resubscribe after reauthentication - #1648

Draft
jlimatampersand wants to merge 1 commit into
mainfrom
jlim/eng-3723-resubscribe-on-reauth
Draft

jlimatampersand wants to merge 1 commit into
mainfrom
jlim/eng-3723-resubscribe-on-reauth

Conversation

@jlimatampersand

Copy link
Copy Markdown
Contributor

Stack: amp-labs/openapi#406 generated client → this PR → amp-labs/server#7297 endpoint

What this PR does

Adds a resubscribeOnReAuth prop to InstallIntegration. When set, reauthenticating an existing connection also restarts subscribe setup for the installation if it never finished — the case where credentials were invalid at install time, so registration failed and no events ever flowed.

<InstallIntegration
  integration="my-integration"
  consumerRef={consumerRef}
  groupRef={groupRef}
  resubscribeOnReAuth
/>

Off by default, so nothing changes for builders who do not opt in. The prop is threaded through the installation context, where the reauthentication components read it.

All four reauthentication components — OAuth, API key, basic auth, and client credentials — converge on one success handler, so this is a single hook called from each, after the credentials are persisted.

The consumer sees nothing

Reauthentication looks exactly as it does today; the reconnect happens behind it. The call is fire-and-forget — it must never block the reauthentication or make a successful credential update look like a failure. It also no-ops without an installation in context, since the update-connection UI can render inside ConnectProvider.

A failed reconnect is therefore invisible to the consumer. That is deliberate: they cannot act on it, and the builder sees it through the operations API and the existing subscribe error notification.

Blocked on

api.installationApi.resubscribeInstallation does not exist until amp-labs/openapi#406 merges and the client is regenerated from main. Everything else typechecks and lints clean; that one call is the only error.

Adds a `resubscribeOnReAuth` prop to InstallIntegration. When set, reauthenticating
an existing connection also restarts subscribe setup for the installation if it
never finished -- the case where credentials were invalid at install time, so
registration failed and no events ever flowed.

Off by default, so nothing changes for builders who do not opt in. The prop is
threaded through the installation context, where the reauthentication components
read it.

All four reauthentication components -- OAuth, API key, basic auth, and client
credentials -- converge on one success handler, so this is a single hook called
from each, after the credentials are persisted.

The consumer sees nothing. Reauthentication looks exactly as it does today and the
reconnect happens behind it. The call is fire-and-forget: it must never block the
reauthentication or make a successful credential update look like a failure. It
also no-ops without an installation in context, since the update-connection UI can
render inside ConnectProvider.

Blocked on amp-labs/openapi#406 for the generated client method; server side is
amp-labs/server#7297.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@linear

linear Bot commented Sep 12, 2026

Copy link
Copy Markdown

ENG-3723

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.

1 participant