fix(ENG-12551): add x-hub-session-token header to connection attempt requests#139
Merged
adefreitas merged 1 commit intoApr 16, 2026
Conversation
Move from /connect_sessions/connection_attempts to /hub/connection_attempts to leverage CloudFront's existing CORS handling for /hub/ paths. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds CloudFront routing support for /hub/connection_attempts by ensuring all connection-attempt requests include the x-hub-session-token header, and updates React callback dependencies/call sites accordingly.
Changes:
- Add
x-hub-session-tokenheader to connection attempt create/poll/cancel requests. - Update
pollConnectionAttempt/cancelConnectionAttemptsignatures to accepttokenand update all call sites. - Add
tokento relevant hook callback dependency arrays; emitAccountConnectedto the parent on polling-based success.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/modules/integration-picker/queries.ts | Adds x-hub-session-token header to connection-attempt HTTP requests; updates function signatures for poll/cancel. |
| src/modules/integration-picker/hooks/useIntegrationPicker.ts | Passes token into poll/cancel calls, updates hook dependencies, and posts AccountConnected to the parent when polling succeeds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+559
to
+564
| parent.postMessage( | ||
| { | ||
| type: EventType.AccountConnected, | ||
| account: { id: result.account.id, provider }, | ||
| }, | ||
| '*', |
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.
Summary
x-hub-session-tokenheader to all connection attempt requests (create, poll, cancel)tokento dependency arrays of callbacks that use itContext
Now that connection attempts are under
/hub/, CloudFront uses thex-hub-session-tokenheader for regional routing. Without this header, requests can't be routed to the correct backend.Test plan
🤖 Generated with Claude Code
Summary by cubic
Add the x-hub-session-token header to connection attempt create/poll/cancel requests under /hub so CloudFront routes to the correct region and polls/cancels stop failing. This enables the ENG-12551 server-side polling flow to work reliably in embedded scenarios.
Written for commit 6baa96f. Summary will update on new commits.