Repository navigation
Fix Disconnect button in integration settings - #4
codecsrayo wants to merge 1 commit into
Conversation
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]>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
…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
…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
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