Skip to content

fix: canonicalize indexed database query parameters#4120

Draft
astandrik wants to merge 2 commits into
mainfrom
codex/4119-canonicalize-query-params
Draft

fix: canonicalize indexed database query parameters#4120
astandrik wants to merge 2 commits into
mainfrom
codex/4119-canonicalize-query-params

Conversation

@astandrik

@astandrik astandrik commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • canonicalize known single-value database query parameters parsed as repeated arrays or indexed objects
  • apply the same normalization to generated links and URL-backed state transitions
  • keep intentional unknown arrays as repeated parameters, remove utm_referrer, and avoid dangling delimiters

Root cause

qs.parse converts repeated or indexed query keys into arrays or objects. The link-generation and unknown-parameter restoration paths serialized those structures without first collapsing known scalar UI state, allowing corrupted database URLs to retain or introduce multiple values and numeric bracket keys.

Impact

Existing corrupted URLs are canonicalized on the next generated link or URL-backed state change. The last scalar value wins, while unlisted multi-value parameters remain multi-valued. This does not add a startup redirect or change the public top-level API.

Validation

  • npm test -- src/store/__test__/state-url-mapping.test.ts src/routes.test.ts --runInBand --no-cache
  • npm run typecheck
  • npm run lint
  • npm test — 123 suites, 1247 tests
  • npm run package

Fixes #4119

CI Results

Test Status: ❌ FAILED

📊 Full Report

Total Passed Failed Flaky Skipped
750 746 1 3 0

😟 No changes in tests. 😕

Bundle Size: 🔺

Current: 64.41 MB | Main: 64.41 MB
Diff: +5.50 KB (0.01%)

⚠️ Bundle size increased. Please review.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

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.

Existing database URLs are re-serialized with indexed query parameters

1 participant