AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Hidden Preserved Route Replays Stale RedirectBoundary Redirect On Forward Navigation When CacheComponents Is Enabled

When cacheComponents is enabled, preserved hidden routes can replay stale RedirectBoundary redirects during forward navigation, causing duplicate route stages to appear before the correct destination. This is due to RedirectBoundary not checking if it is active before handling redirects.

highConfidence 95%Next.jsHydrationTurbopackAffected V16.2.2Affected V16.2.1-Canary.38

Origin Analysis

RedirectBoundary lacks an isActive guard and retains redirect state when the route becomes hidden. During forward navigation, the preserved instance re-executes redirect side effects, causing the same stage to appear again.
1. Clone the repro and install dependencies 2. Run `pnpm patch:off` 3. Run `pnpm dev` 4. Open `/dashboard` 5. Allow the app to redirect to `/verify-identity` 6. Click the button that prepares `onboarding` and then calls `router.replace("/dashboard")` 7. Observe whether `/verify-identity` appears again before the app reaches `/onboarding` 8. On `/onboarding`, click the button that prepares `complete` and then calls `router.replace("/dashboard")` 9. Observe whether `/onboarding` appears again before the app reaches `/complete` 10. Repeat the same comparison with `pnpm patch:on`

Fixing Code Block

Edge Case Audit

The fix should be tested under concurrent React features, multiple tabs, and rapid route transitions. Clearing redirectType during reset could theoretically interfere with redirects that are in flight if the component becomes inactive before reset is called. Rollback by removing the isActive prop and reverting RedirectBoundary to original state. Ensure isActive is correctly synchronized with router state to avoid false negatives.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state