-
Notifications
You must be signed in to change notification settings - Fork 10.9k
fix: include attendeePhoneNumber in booking success redirect URLs #24837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: include attendeePhoneNumber in booking success redirect URLs #24837
Conversation
|
@aadityasingh9601 is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
…github.com:aadityasingh9601/cal.com into fix/add-attendeePhoneNumber-to-redirect-url-params
There was a problem hiding this 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["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.</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 "lodash";` 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"]); |
There was a problem hiding this comment.
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["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.</comment>
<file context>
@@ -91,12 +98,30 @@ export const getBookingRedirectExtraParams = (booking: SuccessRedirectBookingTyp
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"]);
+
+ //Handles both string and object formats for attendeePhoneNumber.
</file context>
| const phoneNumber = getSafe<string>(booking.responses, ["phoneNumber"]); | |
| const phoneNumber = getSafe<string>(booking.responses, ["phoneNumber"]) || getSafe<string>(booking.responses, ["phone"]); |
There was a problem hiding this comment.
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
apps/web/components/settings/platform/dashboard/oauth-clients-list/index.tsx
Show resolved
Hide resolved
There was a problem hiding this 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
|
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. |
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:
attendeePhoneNumberSolution
extractResponseDetailsfunction to extractattendeePhoneNumberfrombooking.responsesattendeePhoneNumbertoqueryCompatibleParamsso it's included in redirect URLsVisual Demo (For contributors especially)
Before:
After:
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
attendeePhoneNumberin a booking type.attendeePhoneNumber.