Skip to content

fix(web): stop the self-hosted ingestion UI throwing on a Clerk hook - #724

Merged
Makisuo merged 1 commit into
fix/03-analytics-bounce-session-versionfrom
fix/04-self-hosted-ingestion-ui
Sep 1, 2026
Merged

fix(web): stop the self-hosted ingestion UI throwing on a Clerk hook#724
Makisuo merged 1 commit into
fix/03-analytics-bounce-session-versionfrom
fix/04-self-hosted-ingestion-ui

Conversation

@Makisuo

@Makisuo Makisuo commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Fourth of a five-PR stack, based on #723.

useGuidedFramework called Clerk's useAuth() unconditionally. main.tsx mounts ClerkProvider only when isClerkAuthEnabled, and the hook throws without one, so on a self-hosted build both

  • /settings, which opens on the ingestion tab, and
  • the dashboard setup checklist

failed to render instead of showing the ingestion configuration. settings-nav.tsx does not filter the ingestion tab for self-hosted, so it is the landing page.

The variant is chosen at module scope off the build-time constant — the shape useOrganizationFeatureFlags already uses, and for the reason documented there: an early return inside the hook runs after useAuth() has already thrown. The self-hosted build keeps its selection under the default key, having one org.

Tests

A case added to guided-setup.test.tsx renders the hook with no provider — the exact production crash, verified to reproduce against the old code. It sits alongside the existing replay-privacy test in that file, which is untouched.

`useGuidedFramework` called Clerk's `useAuth()` unconditionally. `main.tsx`
mounts `ClerkProvider` only when `isClerkAuthEnabled`, and the hook throws
without one, so self-hosted `/settings` — which opens on the ingestion tab —
and the dashboard setup checklist both failed to render instead of showing the
ingestion configuration.

The variant is now chosen at module scope off the build-time constant, the same
shape `useOrganizationFeatureFlags` uses and for the reason documented there: an
early return inside the hook runs after `useAuth()` has already thrown. The
self-hosted build keeps its selection under the default key, having one org.
@Makisuo
Makisuo force-pushed the fix/04-self-hosted-ingestion-ui branch from 256bac6 to 2e3332e Compare September 1, 2026 14:51
@Makisuo
Makisuo merged commit 15c5560 into main Sep 1, 2026
33 checks passed
@Makisuo
Makisuo deleted the fix/04-self-hosted-ingestion-ui branch September 1, 2026 15:33
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

🍁 Maple PR preview

Warning

Preview cleanup could not be confirmed. The Alchemy teardown outcome was skipped.

Final commit 2e3332e · View workflow run

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