[ENG-3723] feat: opt-in resubscribe after reauthentication - #1648
Draft
jlimatampersand wants to merge 1 commit into
Draft
jlimatampersand wants to merge 1 commit into
jlimatampersand wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack: amp-labs/openapi#406 generated client → this PR → amp-labs/server#7297 endpoint
What this PR does
Adds a
resubscribeOnReAuthprop toInstallIntegration. 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; 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.resubscribeInstallationdoes not exist until amp-labs/openapi#406 merges and the client is regenerated frommain. Everything else typechecks and lints clean; that one call is the only error.