Skip to content

Conversation

Copy link

Copilot AI commented Jan 16, 2026

The stringify function was double-encoding nested query parameters beyond 2 levels deep. Encoded keys were passed as prefixes to recursive calls, causing re-encoding at each level.

Example of the bug:

const url = new DynamicURL("https://example.com");
url.setQueryParams({ 
  level1: { level2: { level3: "value" } }
});

// Before: level1%255Blevel2%255D%5Blevel3%5D=value
//         (decodes to: level1%5Blevel2%5D[level3])
// After:  level1%5Blevel2%5D%5Blevel3%5D=value
//         (decodes to: level1[level2][level3])

Changes:

  • Build unencoded key path during recursion
  • Encode once at leaf level only
  • Add regression test for 3+ level nesting

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 16, 2026 09:12
Co-authored-by: bnachtweh <32386227+bnachtweh@users.noreply.github.com>
Co-authored-by: bnachtweh <32386227+bnachtweh@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP address feedback on perf(query) to remove external dependency Fix double encoding in nested query parameters at 3+ levels Jan 16, 2026
Copilot AI requested a review from bnachtweh January 16, 2026 09:15
@bnachtweh bnachtweh marked this pull request as ready for review January 16, 2026 09:16
@bnachtweh bnachtweh merged commit 2a2a24e into 19-add-query-string-parser-with-smaller-footprint Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants