Skip to content

Conversation

@aadityasingh9601
Copy link

What does this PR do?

The attendeePhoneNumber parameter was not being included in booking success redirect URLs despite being properly configured and collected during booking. Even though:

  • Phone field is configured with identifier attendeePhoneNumber
  • Field is marked as required
  • Phone number is successfully collected (appears in confirmation emails)
  • Other parameters (email, attendeeName, etc.) are correctly forwarded

Solution

  • Updated extractResponseDetails function to extract attendeePhoneNumber from booking.responses
  • Handles both string format and object with value property (for different response structures)
  • Added fallback to legacy phone field for backward compatibility
  • Added attendeePhoneNumber to queryCompatibleParams so it's included in redirect URLs

Visual Demo (For contributors especially)

Before:

Screenshot (1088)

After:

Screenshot (1095)

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Configure a phone field with the identifier attendeePhoneNumber in a booking type.
  2. Enable “Forward parameters” in the booking success redirect settings.
  3. Complete a booking with a phone number.
  4. Verify that the redirect URL now includes attendeePhoneNumber.
@aadityasingh9601 aadityasingh9601 requested review from a team as code owners November 1, 2025 06:03
@vercel
Copy link

vercel bot commented Nov 1, 2025

@aadityasingh9601 is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the 🐛 bug Something isn't working label Nov 1, 2025
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Nov 1, 2025
Copy link
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.

10 issues found across 54 files

Prompt for AI agents (all 10 issues)

Understand the root cause of the following 10 issues and fix them.


<file name="apps/web/modules/apps/[slug]/slug-view.tsx">

<violation number="1" location="apps/web/modules/apps/[slug]/slug-view.tsx:69">
Removing the eslint-disable comment here re-enables react/no-danger while we still rely on dangerouslySetInnerHTML, so linting will fail. Please restore the disable comment.</violation>
</file>

<file name="packages/lib/testSMS.ts">

<violation number="1" location="packages/lib/testSMS.ts:2">
Removing the eslint-disable comment causes ESLint’s `no-var` rule to flag the required `var testSMS` declaration, breaking lint. Please restore the suppression or otherwise allow this declaration.</violation>
</file>

<file name="packages/lib/server/i18n.ts">

<violation number="1" location="packages/lib/server/i18n.ts:8">
Removing the ESLint disable reintroduces an @typescript-eslint/no-var-requires violation for the require call below, which will break linting. Please restore the directive or refactor the import.</violation>
</file>

<file name="apps/web/playwright/lib/fixtures.ts">

<violation number="1" location="apps/web/playwright/lib/fixtures.ts:3">
Removing the `no-restricted-imports` suppression reintroduces the lint violation for the adjacent Playwright import, so linting will now fail. Please restore the disable comment.</violation>
</file>

<file name="packages/features/bookings/lib/bookingSuccessRedirect.ts">

<violation number="1" location="packages/features/bookings/lib/bookingSuccessRedirect.ts:102">
The new extraction only reads booking.responses[&quot;phoneNumber&quot;], so legacy responses that still populate the &quot;phone&quot; key stop forwarding the attendee phone in redirect URLs. Please keep the fallback to the legacy key.</violation>
</file>

<file name="apps/web/modules/videos/views/videos-single-view.tsx">

<violation number="1" location="apps/web/modules/videos/views/videos-single-view.tsx:490">
Removing the react/no-danger suppression here reintroduces the lint error for this dangerouslySetInnerHTML usage; please add the disable back or otherwise satisfy the rule.</violation>
</file>

<file name="apps/web/components/apps/installation/EventTypesStepCard.tsx">

<violation number="1" location="apps/web/components/apps/installation/EventTypesStepCard.tsx:67">
Removing the `react/no-danger` suppression here causes the linter to flag this `dangerouslySetInnerHTML` usage, so the lint step will fail. Please restore the disable comment.</violation>
</file>

<file name="apps/web/components/settings/platform/dashboard/oauth-clients-list/index.tsx">

<violation number="1" location="apps/web/components/settings/platform/dashboard/oauth-clients-list/index.tsx:82">
Please wrap the fallback label in the localization helper instead of hard-coding the string so this button respects translations.</violation>
</file>

<file name="apps/web/pages/_document.tsx">

<violation number="1" location="apps/web/pages/_document.tsx:57">
Dropping the eslint-disable guard causes `react/no-danger` to flag this script, so linting will fail. Please restore the suppression or refactor the script to avoid `dangerouslySetInnerHTML`.</violation>
</file>

<file name="apps/web/modules/settings/my-account/profile-view.tsx">

<violation number="1" location="apps/web/modules/settings/my-account/profile-view.tsx:5">
Removing this eslint-disable line re-enables `no-restricted-imports`, and the remaining `import { get, pick } from &quot;lodash&quot;;` now triggers a lint error. Please restore the suppression or refactor the import to the allowed scoped modules so CI passes.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

const result: ResultType = { ...obj };
const phone = getSafe<string>(booking.responses, ["phone"]);
//Extact both phoneNumber and attendeePhoneNumber from response.
const phoneNumber = getSafe<string>(booking.responses, ["phoneNumber"]);
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 1, 2025

Choose a reason for hiding this comment

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

The new extraction only reads booking.responses["phoneNumber"], so legacy responses that still populate the "phone" key stop forwarding the attendee phone in redirect URLs. Please keep the fallback to the legacy key.

Prompt for AI agents
Address the following comment on packages/features/bookings/lib/bookingSuccessRedirect.ts at line 102:

<comment>The new extraction only reads booking.responses[&quot;phoneNumber&quot;], so legacy responses that still populate the &quot;phone&quot; key stop forwarding the attendee phone in redirect URLs. Please keep the fallback to the legacy key.</comment>

<file context>
@@ -91,12 +98,30 @@ export const getBookingRedirectExtraParams = (booking: SuccessRedirectBookingTyp
     const result: ResultType = { ...obj };
-    const phone = getSafe&lt;string&gt;(booking.responses, [&quot;phone&quot;]);
+    //Extact both phoneNumber and attendeePhoneNumber from response.
+    const phoneNumber = getSafe&lt;string&gt;(booking.responses, [&quot;phoneNumber&quot;]);
+
+    //Handles both string and object formats for attendeePhoneNumber.
</file context>
Suggested change
const phoneNumber = getSafe<string>(booking.responses, ["phoneNumber"]);
const phoneNumber = getSafe<string>(booking.responses, ["phoneNumber"]) || getSafe<string>(booking.responses, ["phone"]);
Fix with Cubic
Copy link
Member

Choose a reason for hiding this comment

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

@aadityasingh9601 please add this fallback

Copy link
Member

@dhairyashiil dhairyashiil left a comment

Choose a reason for hiding this comment

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

Please address the above comment, and revert the unrelated eslint-disable comment removals. totally unrelated to this PR's agenda. making it draft until then

@dhairyashiil dhairyashiil marked this pull request as draft November 1, 2025 17:45
@aadityasingh9601
Copy link
Author

aadityasingh9601 commented Nov 2, 2025

Apologies for the messy PR. I accidentally merged main into my feature branch. Closing this & opening a clean PR with only the phone number fix.

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

Labels

🐛 bug Something isn't working community Created by Linear-GitHub Sync size/L

2 participants