Skip to content

fix: use eventType description and booking description correctly in CalendarEvent (#28818)#28864

Open
m1lestones wants to merge 1 commit intocalcom:mainfrom
m1lestones:fix/calendar-event-description-additionalNotes-28818
Open

fix: use eventType description and booking description correctly in CalendarEvent (#28818)#28864
m1lestones wants to merge 1 commit intocalcom:mainfrom
m1lestones:fix/calendar-event-description-additionalNotes-28818

Conversation

@m1lestones
Copy link
Copy Markdown

@m1lestones m1lestones commented Apr 13, 2026

Summary

Fixes #28818 - Booking confirmation emails now correctly display event type description and attendee notes in their respective fields.

Problem

Confirmation emails were showing attendee notes (booking.description) in the description field instead of the event type's description. The additionalNotes field was never populated.

Solution

  • CalendarEvent.description now uses eventType.description (event type's description)
  • CalendarEvent.additionalNotes now uses booking.description (attendee's booking notes)
  • Uses || null for additionalNotes normalization (not || undefined)

Changes

  • Updated buildCalendarEvent() in addGuests.handler.ts
  • Updated buildCalEventFromBooking() in buildCalEventFromBooking.ts
  • Fixed CalendarEvent creation in confirm.handler.ts
  • Fixed CalendarEvent creation in payment/getBooking.ts
  • Updated tests in buildCalEventFromBooking.test.ts

Test Plan

  • Updated existing unit tests
  • CI tests will verify type checking and linting
  • Manual testing: create a booking and verify confirmation email shows correct description

Before

  • Description field: showed attendee notes
  • Additional Notes field: empty/undefined

After

  • Description field: shows event type description
  • Additional Notes field: shows attendee notes

…alendarEvent (calcom#28818)

Previously, CalendarEvent.description was incorrectly set to booking.description (attendee notes),
and CalendarEvent.additionalNotes was not set at all. This caused confirmation emails to show
attendee notes in the description field instead of the event type's description.

Changes:
- Set CalendarEvent.description to eventType.description (event type's description)
- Set CalendarEvent.additionalNotes to booking.description (attendee's notes)
- Updated buildCalendarEvent in addGuests.handler.ts
- Updated buildCalEventFromBooking in buildCalEventFromBooking.ts
- Updated CalendarEvent creation in confirm.handler.ts
- Updated CalendarEvent creation in payment/getBooking.ts
- Updated tests to verify both fields are set correctly

Fixes calcom#28818
@m1lestones m1lestones requested a review from a team as a code owner April 13, 2026 07:34
@github-actions github-actions bot added the 🐛 bug Something isn't working label Apr 13, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

The pull request refactors how event descriptions are handled across the booking system. The description field is changed to source from booking.eventType?.description instead of booking.description. A new additionalNotes field is introduced to capture the original booking description. The EventType type is updated to include a description: string | null field. These changes affect the payment booking handler, build utilities, test fixtures, and multiple TRPC router handlers related to bookings (addGuests and confirm handlers).

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: fixing the use of eventType description and booking description in CalendarEvent.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the problem, solution, and changes made across multiple files.
Linked Issues check ✅ Passed The pull request directly addresses issue #28818 by fixing CalendarEvent to use eventType.description for description field and booking.description for additionalNotes field [#28818].
Out of Scope Changes check ✅ Passed All changes are focused on fixing the description field handling across CalendarEvent creation, with corresponding test updates; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/trpc/server/routers/viewer/bookings/confirm.handler.ts`:
- Around line 320-321: The object literal in confirm.handler.ts defines
additionalNotes twice causing the later raw assignment additionalNotes:
booking.description to override the earlier normalized additionalNotes:
booking.description || null; remove the duplicate raw assignment
(additionalNotes: booking.description) so only the normalized additionalNotes:
booking.description || null remains (matching buildCalEventFromBooking,
addGuests.handler, getBooking patterns).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7fceabfe-deda-4793-9c2d-f218315c3f75

📥 Commits

Reviewing files that changed from the base of the PR and between 2911168 and b99c30f.

📒 Files selected for processing (5)
  • packages/features/bookings/lib/payment/getBooking.ts
  • packages/lib/__tests__/buildCalEventFromBooking.test.ts
  • packages/lib/buildCalEventFromBooking.ts
  • packages/trpc/server/routers/viewer/bookings/addGuests.handler.ts
  • packages/trpc/server/routers/viewer/bookings/confirm.handler.ts

Comment on lines +320 to +321
description: booking.eventType?.description || "",
additionalNotes: booking.description || null,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Duplicate additionalNotes property causes inconsistent behavior.

additionalNotes is assigned twice in this object literal:

  • Line 321: additionalNotes: booking.description || null (normalizes falsy values to null)
  • Line 368: additionalNotes: booking.description (raw value, no normalization)

Since line 368 comes after line 321, it overrides the first assignment. This creates a semantic difference: an empty string "" would be normalized to null on line 321 but passed through as "" on line 368.

This is inconsistent with the other files in this PR (buildCalEventFromBooking.ts, addGuests.handler.ts, getBooking.ts) which all use the || null normalization pattern.

🐛 Proposed fix: Remove the duplicate assignment
     ...(platformClientParams ? platformClientParams : {}),
     organizationId: organizerOrganizationId ?? booking.eventType?.team?.parentId ?? null,
-    additionalNotes: booking.description,
     assignmentReason: booking.assignmentReason?.[0]?.reasonEnum

Also applies to: 368-368

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/trpc/server/routers/viewer/bookings/confirm.handler.ts` around lines
320 - 321, The object literal in confirm.handler.ts defines additionalNotes
twice causing the later raw assignment additionalNotes: booking.description to
override the earlier normalized additionalNotes: booking.description || null;
remove the duplicate raw assignment (additionalNotes: booking.description) so
only the normalized additionalNotes: booking.description || null remains
(matching buildCalEventFromBooking, addGuests.handler, getBooking patterns).

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.

Call confirmations are showing wrong description (uses additional notes instead)

1 participant