Conversation
…alled Customer report: a first-time user completing the connect flow was only asked to authorize their personal account, never got to install the App on their org or pick repositories, and the integration never showed as connected. Root cause: GitHub separates user *authorization* from app *installation*. The authorize URL (login/oauth/authorize) only authenticates the user — it does not install the App. So a first-time user authorized, the post-OAuth install check correctly found no installation, and the connection was (correctly) not finalized — but the user was never given a way to install. Fix: when the install check finds no installation, redirect the user to the App's install URL (new `installUrl` manifest field) so they install on their org and choose repositories. They return through install-time OAuth (which carries an `installation_id`), the check passes, and the connection is finalized. The `installation_id` on the return trip is read only as a loop guard (never persisted) so we don't redirect a second time. Already-installed / reconnect users are unaffected (the check passes on the first callback). Tests: redirect-to-install on first pass, error (no loop) after an install attempt, and success when an installation already exists. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XyttkYNbkdYRp7DBKNuFVH
…ll-redirect fix(integrations): redirect GitHub App users to install when not installed (CS-710)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Confidence score: 5/5
- Safe to merge after the addressed issues were fixed.
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
cubic caught an error-path ordering bug: the GitHub App install redirect deleted the original OAuth state before creating the install-handoff state. If the create failed, the outer catch would call delete(state) again on an already-removed record — Prisma's delete throws P2025, so the error redirect never ran and the request hung. Create the install-handoff state first, then delete the original. On a create failure the original state survives, so the outer catch cleans it up and still emits an error redirect. Add regression tests for the create-before-delete ordering and the create-failure path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XyttkYNbkdYRp7DBKNuFVH
…ring fix(integrations): create install-handoff state before deleting original (CS-710)
Contributor
|
🎉 This PR is included in version 3.99.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.
Summary by cubic
Redirects first-time GitHub App connections to the GitHub install page when no installation is found and fixes an ordering bug that could hang the OAuth callback (CS-710). Prevents “authorized but not installed” dead-ends and avoids redirect loops.
github-appand no installation exists, redirect to the AppinstallUrlwith a fresh state; on return withinstallation_idand still no install, surfacegithub_app_not_installedinstead of looping.installUrlto OAuth config and set it forgithub-apptohttps://github.com/apps/comp-ai-compliance/installations/new; tests cover first-pass redirect, create-before-delete ordering and create-failure path, no-loop after an install attempt, and success when an installation already exists.Written for commit fe63eb1. Summary will update on new commits.