Skip to content

Fix Disconnect button in integration settings - #4

Closed
codecsrayo wants to merge 1 commit into
feature/integrations-panel-fix-17593507967815292912from
fix/github-disconnect-button-12484532058975248394
Closed

codecsrayo wants to merge 1 commit into
feature/integrations-panel-fix-17593507967815292912from
fix/github-disconnect-button-12484532058975248394

Conversation

@codecsrayo

Copy link
Copy Markdown
Owner

This PR fixes the 'Disconnect' button in the GitHub (and other) integration settings. The issue was a mismatch between the frontend service and the backend API routes. The frontend was attempting to call DELETE /api/workspaces/{slug}/workspace-integrations/{integration_id}/provider/, which resulted in a 404 error because the backend expects either a UUID-based DELETE or a provider-name based DELETE at that specific suffix. By removing the /provider/ suffix, the frontend now correctly calls the ID-based deletion endpoint.


PR created automatically by Jules for task 12484532058975248394 started by @codecsrayo

The 'Disconnect' button in integration settings was failing because the
frontend was calling an incorrect URL format (appending '/provider/' to
the UUID-based endpoint).

Updated `IntegrationService.deleteWorkspaceIntegration` to use the
standard resource deletion URL which is correctly handled by the backend
'destroy' method.

This fixes the issue where users were seeing a "Could not disconnect
GitHub" error when trying to remove an integration.

Co-authored-by: codecsrayo <[email protected]>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@codecsrayo
codecsrayo deleted the branch feature/integrations-panel-fix-17593507967815292912 April 7, 2026 01:01
@codecsrayo codecsrayo closed this Apr 7, 2026
@codecsrayo
codecsrayo deleted the fix/github-disconnect-button-12484532058975248394 branch April 7, 2026 14:46
codecsrayo pushed a commit that referenced this pull request Apr 17, 2026
…rUrls

Fix #4 — Triplicación de páginas de callback (~300 líneas duplicadas)
- Crea apps/web/core/components/integration/oauth-callback-page.tsx
  · Componente stateless OAuthCallbackPage con props:
    status (processing | success | error), errorMessage,
    processingText, successText
  · Exporta tipo TOAuthCallbackStatus para reutilización segura
- Refactoriza github/callback/page.tsx, gitlab/callback/page.tsx y
  slack/callback/page.tsx para delegar toda la UI al componente compartido
  · Cada página conserva únicamente la lógica de negocio específica del
    proveedor (parseo de query-string, llamada al servicio, postMessage)
  · Eliminadas ~70 líneas de JSX idéntico por archivo (210 líneas totales)

Fix #5 — providerUrls reconstruido en cada render
- use-integration-popup.tsx: buildProviderUrl envuelto en useMemo
  · Dependencias explícitas: github_app_name, gitlab_client_id,
    gitlab_host, slack_client_id, workspaceSlug, projectId, stateParams
  · El nonce NO figura como dependencia — se pasa como argumento en
    call-time dentro de openPopup para que cada startAuth genere un
    nonce fresco sin disparar un ciclo de re-render
codecsrayo pushed a commit that referenced this pull request Apr 18, 2026
…Error, URL encoding, useMemo→useCallback

#3 — setInterval sin cleanup:
- Extraído interval ID a intervalRef (useRef) en lugar de variable local
- Añadido useEffect de unmount que llama clearInterval(intervalRef.current)
- Patrón idéntico al ya usado en personal-connect-card.tsx:58,76-81

#4 — popup.current.closed sin try/catch:
- Envuelto el acceso a popup.current.closed en try/catch
- SecurityError en popup cross-origin ahora se trata como 'closed'
- El guard === undefined previo no cubría el throw

#5 — URLs construidas sin encodeURIComponent:
- workspaceSlug, projectId y stateParams ahora se encodean antes
  de inyectarse en el parámetro state=
- Slug con &, #, = o espacios ya no corrompe el parseo del callback
- Nonce (UUID, url-safe) también encodificado defensivamente
- slackChannelState construido con variables intermedias encodificadas

#6 — useMemo retornando función:
- Cambiado useMemo(() => (nonce) => ...) → useCallback((nonce) => ...)
- Eliminado el eslint-disable-next-line innecesario (deps estaban completas)
- Import: reemplazado useMemo por useCallback
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