Skip to content

fix: preserve repeated search params in client page segment cache keys - #94863

Merged
icyJoseph merged 4 commits into
canaryfrom
worktree-stale-query-param-cache-key
Jun 29, 2026
Merged

icyJoseph merged 4 commits into
canaryfrom
worktree-stale-query-param-cache-key

Conversation

@icyJoseph

@icyJoseph icyJoseph commented Jun 16, 2026 •

Copy link
Copy Markdown
Member

Fixes: #94821, #92787, #93104

Using Object.fromEntries on URLSearchParams, drops repeated keys.

const s = '?foo=bar&foo=baz'
Object.fromEntries(new URLSearchParams(s)) // { foo: 'baz' }

There's already a function, urlSearchParamsToParsedUrlQuery, which handles this case.

export function urlSearchParamsToParsedUrlQuery(

urlSearchParamsToParsedUrlQuery(new URLSearchParams(s)) // { foo: ['bar', 'baz'] }
  • The e2e off one of the issue reports, I'll try to simplify it.

@github-actions

github-actions Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: 2023d01

@github-actions

github-actions Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Stats cancelled

Commit: 2023d01
View workflow run

@icyJoseph
icyJoseph force-pushed the worktree-stale-query-param-cache-key branch from aa546bf to eb244b3 Compare June 16, 2026 22:53
@icyJoseph
icyJoseph marked this pull request as ready for review June 16, 2026 22:53
@icyJoseph
icyJoseph requested a review from acdlite June 17, 2026 08:07
@icyJoseph
icyJoseph merged commit c3bf2a3 into canary Jun 29, 2026
223 of 226 checks passed
@icyJoseph
icyJoseph deleted the worktree-stale-query-param-cache-key branch June 29, 2026 11:54
m-kawafuji pushed a commit to m-kawafuji/next.js that referenced this pull request Aug 8, 2026
vercel#94863)

Fixes: vercel#94821, vercel#92787, vercel#93104

Using `Object.fromEntries` on URLSearchParams, drops repeated keys.

```js
const s = '?foo=bar&foo=baz'
Object.fromEntries(new URLSearchParams(s)) // { foo: 'baz' }
```

There's already a function, `urlSearchParamsToParsedUrlQuery`, which
handles this case.


https://github.com/vercel/next.js/blob/40296fe53f40ffe6a0e2184879bd5e294d271ce4/packages/next/src/client/route-params.ts#L235

```js
urlSearchParamsToParsedUrlQuery(new URLSearchParams(s)) // { foo: ['bar', 'baz'] }
```

- [x] The e2e off one of the issue reports, I'll try to simplify it.
@stephenhmarsh

stephenhmarsh commented Aug 19, 2026 •

Copy link
Copy Markdown

it sounds like this fixes #92152 too, no?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Submitting Query Parameters via a Form does not always update the client with the newly server rendered content

3 participants