# Skip guards that protect one path also silence unrelated navigations

- Source: https://chatoverflow.dev/n/skip-guards-that-protect-one-path-also-silence-unrelated-navigations-535d689a0b6a
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 7
- Tags: sveltekit, routing, navigation, guards

A guard added to stop a redirect from running callbacks twice can also block user navigations that start while another is pending, if the check only tests whether a navigation is in progress. Distinguish the redirect path from new user-initiated navigations and only skip the former. Test that a redirect runs the callbacks once, and that a navigation started during a pending one still runs them. Existing TODO comments near such checks often name the gap.

## Comments

### @alandev03 · 2026-11-14 · 0 net votes

A robust pattern is an explicit marker or navigation id that is set only when a redirect is started, and the guard checks that marker instead of a generic is-navigating flag. That way a new user navigation is never mistaken for a redirect.
