Skip to content

fix: preserve array query params in redirect URL serialization#28688

Draft
Akash504-ai wants to merge 5 commits intocalcom:mainfrom
Akash504-ai:fix/query-params-serialization
Draft

fix: preserve array query params in redirect URL serialization#28688
Akash504-ai wants to merge 5 commits intocalcom:mainfrom
Akash504-ai:fix/query-params-serialization

Conversation

@Akash504-ai
Copy link
Copy Markdown

@Akash504-ai Akash504-ai commented Mar 31, 2026

What does this PR do?

Fixes incorrect serialization of query parameters containing array values in redirect logic.

Previously, context.query was cast to Record<string, string> and passed to URLSearchParams, which caused array query params to be flattened (e.g. user=john,doe instead of user=john&user=doe).

This PR ensures query params are properly preserved by handling both string and string[] values.


How should this be tested?

  1. Open a URL with repeated query params: /john+doe?user=john&user=doe

  2. Trigger a redirect (dynamic group or single event).

  3. Verify the redirected URL:

  • Before fix: user=john,doe
  • After fix: user=john&user=doe

Mandatory Tasks

  • I have self-reviewed the code
  • I have updated the developer docs if required (N/A)
  • I confirm tests are not required for this small fix

Checklist

  • My PR is small and focused (1 file change)
  • Code follows existing style

Open with Devin

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 31, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the 🐛 bug Something isn't working label Mar 31, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@Akash504-ai
Copy link
Copy Markdown
Author

All checks look good except PR Update / required ( it seems unrelated to this change). Ready for review.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Member

@sahitya-chandra sahitya-chandra Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is dead code now, we can remove this import { encode } from "node:querystring";

Copy link
Copy Markdown
Member

@sahitya-chandra sahitya-chandra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks fine, but can you still add a before and after video of changes

@sahitya-chandra sahitya-chandra marked this pull request as draft April 1, 2026 09:20
@Akash504-ai
Copy link
Copy Markdown
Author

Before:
Query params with array values were flattened: user=john%2Cdoe

After:
Query params are preserved correctly: user=john&user=doe

Example.Domain.-.Brave.2026-04-01.15-50-40.mp4

@Akash504-ai Akash504-ai marked this pull request as ready for review April 2, 2026 05:43
@Akash504-ai
Copy link
Copy Markdown
Author

Ready for review. All feedback addressed and branch updated.

Copy link
Copy Markdown
Member

@sahitya-chandra sahitya-chandra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a video of issue being reproduced on locally running cal.com, not on example.com

@sahitya-chandra sahitya-chandra marked this pull request as draft April 2, 2026 11:11
@Akash504-ai
Copy link
Copy Markdown
Author

Akash504-ai commented Apr 2, 2026

Hi, I tried setting up cal.com locally to reproduce the issue, but I am running into persistent environment/database setup issues (Prisma/Postgres access errors) that seem unrelated to the PR. I have demonstrated the exact root cause and fix using URLSearchParams behavior (array serialization vs append), which is the underlying issue this PR addresses.

Would that be sufficient, or is there a specific minimal setup or route I should use in the app to reproduce this without full local setup?

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

Labels

🐛 bug Something isn't working size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect serialization of array query parameters in redirect logic

3 participants