Skip to content

fix(runtime): make the connector Connect button a real navigation - #30

Merged
lukaisailovic merged 1 commit into
mainfrom
fix/connector-connect-client-nav
Jun 24, 2026
Merged

fix(runtime): make the connector Connect button a real navigation#30
lukaisailovic merged 1 commit into
mainfrom
fix/connector-connect-client-nav

Conversation

@lukaisailovic

Copy link
Copy Markdown
Owner

What

Clicking Connect in the Connections dialog landed on App not found / Available apps: … instead of starting the OAuth flow:

http://<host>/api/connectors/whoop/auth/start?app=health  →  "App not found"

Root cause

Kumo's LinkProvider routes every Kumo link through RouterLink, which rendered a TanStack <Link to> for every href. The "Connect" LinkButton (and SourceDoc's file/external links) point at server routes under /api/. A <Link> does a client-side SPA navigation, so clicking Connect navigated the router to /api/connectors/.../auth/start — a route with no client component. The router fell through to $appId's notFoundComponent ("App not found"), and the browser never reached the server handler that 302s to the OAuth provider.

The bug is latent (RouterLink has been this way since the start), but the multi-app migration is what surfaced this message: the $appId route — and its "App not found / Available apps" notFoundComponent — is what now renders for the unmatched client route.

Fix

RouterLink now renders a plain <a href> (a real browser navigation) for destinations that aren't client routes — server endpoints under /api/ and external URLs — while in-app paths keep using the router. This is the single seam every Kumo link passes through, so it also fixes SourceDoc's /api/file download button and external source links, which had the same latent break.

Verification

Driven in a real browser against the example workspace:

  • Before: click Connect → URL /api/connectors/whoop/auth/start?app=health, page shows "App not found / Available apps: finance, health, …".
  • After: click Connect → browser navigates to the WHOOP authorize URL (the OAuth flow proceeds).

Added test/routerLink.test.tsx to lock the behavior (a /api/ href and an external URL must render real anchors). pnpm typecheck / test (383 passing) / lint all green.

Kumo's LinkProvider routes every Kumo link through RouterLink, which
rendered a TanStack <Link to> for every href. The Connections dialog's
"Connect" button (and SourceDoc's file/external links) point at server
routes under /api/, so clicking them did a client-side SPA navigation to
a route with no client component — the router fell through to $appId's
notFoundComponent and showed "App not found". The browser never reached
the handler that 302s to the OAuth provider.

The multi-app migration surfaced it: $appId (and its "App not found"
notFoundComponent) is what now renders for the unmatched client route.

RouterLink now renders a plain <a href> for destinations that aren't
client routes — server endpoints under /api/ and external URLs — so they
do a real browser navigation. In-app paths still use the router.
@lukaisailovic
lukaisailovic merged commit 8d0001b into main Jun 24, 2026
2 checks passed
@lukaisailovic
lukaisailovic deleted the fix/connector-connect-client-nav branch June 24, 2026 20:00
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