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

Safari Back Navigation After Quit/Reopen Shows Stale Content

When a Next.js app is restored in Safari after quitting and reopening, clicking back changes the URL but leaves the page content of the previous route, due to router state not being re-synchronized with bfcache/session restore.

highConfidence 65%Next.jsReact Server ComponentsServer Actionsnext buildAffected V^12.2.0Affected V^14.2.3Affected V^14.2.35Affected V15.5.9Affected V^16.1.6Affected V16.2.0-Canary.48

Origin Analysis

Next.js router does not properly re-synchronize with the browser history when a page is restored from Safari's back-forward cache/session restore, leaving the React component tree stale while the URL changes.
1. In Safari, set resume with last session tabs. 2. Open a Next.js app, navigate to /route-1. 3. Quit Safari completely. 4. Reopen Safari; the tab shows /route-1 with back button enabled. 5. Click back; URL changes to / but content remains /route-1.

Fixing Code Block

Edge Case Audit

Forcing a full reload on every bfcache restore may cause a visible blink and slower back/forward navigation, and could interfere with progressive web app caching or offline use. It also does not address the underlying root cause; apply as a temporary workaround and test thoroughly on Safari (macOS/iOS). If behavior worsens, remove the listener or set a flag to reload only when route mismatch is detected.

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