Repository navigation
fix: set up frontend telemetry reactively instead of blocking load - #4891
Merged
Merged
Conversation
- 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
| onMount(async () => { | ||
| const revoked = await authService.logout(queryClient); | ||
| await goto(resolve('/(auth)/login/[[mode]]', {}), { replaceState: true }); | ||
| await goto(resolve('/(auth)/login/[[mode]]', {}), { replace: true }); |
There was a problem hiding this comment.
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
Is this helpful? React 👍 or 👎 to let us know.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
mainbranchm.*())What This PR Implements
Fixes the Firefox stall after OIDC login in dev, and stops the root
loadfrom waiting on the telemetry SDK.locale-modulesoutput undervite dev.loadinto a$effectin+layout.svelte, so it follows settings and version changes. The rootloadno longer waits up to 2 seconds for the SDK.replace: trueinstead ofreplaceState: true.Relates to: #4840
Changes Made
frontend/vite.config.ts: ParaglideoutputStructureislocale-moduleswhencommand === 'serve',virtual-modulesotherwise.frontend/src/routes/+layout.ts: removed thesetTelemetrycall and the 2 second await fromload.frontend/src/routes/+layout.svelte: new$effectcallssetTelemetryfromsettingsStore.runtimeanddata.versionInformation.currentVersion.frontend/src/routes/(auth)/logout/+page.svelte:gotooptionreplaceState: truechanged toreplace: true.Testing Done
just format frontendandjust lint frontendpass on the final state.AI Tool Used (if applicable)
Additional Context
loadno longer waits for telemetry. Not verified.vite dev. Production builds keepvirtual-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.

Confidence Score: 5/5
The PR appears safe to merge.Summary
Moves frontend telemetry setup out of page loading and into a reactive layout effect.
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