history.pushState reverts when prefetched Link and proxy.ts cookie-based redirect coexist
In Next.js 16.1.7, calling history.pushState to update a URL query parameter on a route containing a prefetched <Link> to the same dynamic segment may immediately revert to the previous URL. The regression occurs when a proxy.ts middleware redirects to restore a cookie-stored parameter, and a useEffect writes that parameter to a cookie. The router's prefetch cache fuzzy-matches the old entry and dispatches a restore action, undoing the user's navigation.
