Skip to content

fix: set up frontend telemetry reactively instead of blocking load - #4891

Merged
kmendell merged 1 commit into
mainfrom
fix/firefox-issue-4840
Nov 18, 2026
Merged

kmendell merged 1 commit into
mainfrom
fix/firefox-issue-4840

Conversation

@kmendell

@kmendell kmendell commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Checklist

  • This PR is not opened from my fork's main branch
  • All new user-facing strings are translated via Paraglide (m.*())

What This PR Implements

Fixes the Firefox stall after OIDC login in dev, and stops the root load from waiting on the telemetry SDK.

  • Paraglide uses locale-modules output under vite dev.
  • Telemetry setup moves out of the root load into a $effect in +layout.svelte, so it follows settings and version changes. The root load no longer waits up to 2 seconds for the SDK.
  • Logout redirect uses replace: true instead of replaceState: true.

Relates to: #4840

Changes Made

  • frontend/vite.config.ts: Paraglide outputStructure is locale-modules when command === 'serve', virtual-modules otherwise.
  • frontend/src/routes/+layout.ts: removed the setTelemetry call and the 2 second await from load.
  • frontend/src/routes/+layout.svelte: new $effect calls setTelemetry from settingsStore.runtime and data.versionInformation.currentVersion.
  • frontend/src/routes/(auth)/logout/+page.svelte: goto option replaceState: true changed to replace: true.

Testing Done

  • just format frontend and just lint frontend pass on the final state.
  • The Paraglide change and the telemetry move were each measured in Firefox against the dev server before the final state was assembled.
  • The final four-file state was not rerun in Firefox.
  • No tests added: this is a bug fix.

AI Tool Used (if applicable)

Additional Context

  • The first page view's trace may be incomplete now that load no longer waits for telemetry. Not verified.
  • The Paraglide change only affects vite dev. Production builds keep virtual-modules.

Disclaimer Greptiles Reviews use AI, make sure to check over its work.

To better help train Greptile on our codebase, if the comment is useful and valid Like the comment, if its not helpful or invalid Dislike

To have Greptile Re-Review the changes, mention greptileai.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Moves frontend telemetry setup out of page loading and into a reactive layout effect.

  • The first page opens without waiting for telemetry setup.
  • The dev server uses locale modules for Paraglide messages.
  • The logout redirect replaces the current entry when it goes to login.

No actionable issues found. Reviewed source only; browser checks were not run. kmendell notes that the first page trace may be incomplete.

Reviews (1) · Last reviewed commit: "fix: set up frontend telemetry reactivel..." · Reviewed by Greptile

- Move telemetry setup out of the root load into a $effect in the root layout, so page load no longer waits up to 2s for the telemetry SDK.
- Re-run telemetry setup when the frontend tracing, metrics, or logs runtime settings change.
- Logout redirect passes `replace: true`.
- Paraglide emits locale-modules in dev and virtual-modules in build.

Refs #4840
@kmendell
kmendell requested a review from a team November 18, 2026 23:46
onMount(async () => {
const revoked = await authService.logout(queryClient);
await goto(resolve('/(auth)/login/[[mode]]', {}), { replaceState: true });
await goto(resolve('/(auth)/login/[[mode]]', {}), { replace: true });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace is not a valid option for SvelteKit's goto. The supported option is replaceState, and replaceState: true was the correct usage here. With { replace: true } the option is ignored (and fails svelte-check type checking). Logout then pushes a new history entry instead of replacing the logout page. Pressing Back returns to /logout, which re-runs onMount and logs the user out again, so the user can get stuck in a back-button loop.

await goto(resolve('/(auth)/login/[[mode]]', {}), { replaceState: true });

If the aim was to fix the Firefox stall, the fix needs to go through a supported option.

Suggested change
await goto(resolve('/(auth)/login/[[mode]]', {}), { replace: true });
await goto(resolve('/(auth)/login/[[mode]]', {}), { replaceState: true });

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@kmendell
kmendell merged commit 59988fc into main Nov 18, 2026
20 of 21 checks passed
@kmendell
kmendell deleted the fix/firefox-issue-4840 branch November 18, 2026 23:52
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