Skip to content

feat: disable recording emails for guests #22457

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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

naaa760
Copy link

@naaa760 naaa760 commented Jul 13, 2025

What does this PR do?

This PR adds the ability to disable recording download emails for guests in Cal Video meetings while still sending them to organizers. This gives event organizers more control over email notifications sent to attendees.

The new setting "Disable recording emails for guests" is added to the Cal Video settings section, allowing organizers to control whether guests receive recording download emails.

Mandatory Tasks

  • I have self-reviewed the code
  • I have updated the developer docs in /docs
  • I confirm automated tests are in place

How should this be tested?

  1. Testing Steps:

    1. Create or edit an event type with Cal Video
    2. In the Location tab, find Cal Video settings
    3. Enable the new "Disable recording emails for guests" toggle
    4. Save the event type
    5. Create a test booking with this event type
    6. Host the meeting and record it
    7. End the meeting and wait for the recording to process
  2. Expected Behavior:

    • Organizer should receive the recording download email
    • Guests should NOT receive the recording download email when the setting is enabled
    • Guests should receive the recording download email when the setting is disabled
  3. Test Cases:

    • Toggle enabled: Only organizer receives email
    • Toggle disabled: Both organizer and guests receive email
    • Setting persists after event type updates
    • Works with both single and recurring meetings

Implementation Details

The feature includes:

  1. New database column disableRecordingEmailsForGuests in CalVideoSettings
  2. Updated email sending logic to respect the new setting
  3. UI toggle in event type settings
  4. Migration for existing event types (defaults to false)

Summary by cubic

Added a new setting to disable recording download emails for guests in Cal Video meetings, so only organizers receive them if enabled.

  • New Features
    • Added "Disable recording emails for guests" toggle in Cal Video settings.
    • Updated email logic and database to support this setting.

@naaa760 naaa760 requested review from a team as code owners July 13, 2025 19:47
@CLAassistant
Copy link

CLAassistant commented Jul 13, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ naaa760
✅ anikdhabal
❌ nehaaaa8


nehaaaa8 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Jul 13, 2025
@graphite-app graphite-app bot requested a review from a team July 13, 2025 19:47
Copy link

vercel bot commented Jul 13, 2025

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

A member of the Team first needs to authorize it.

Copy link
Contributor

github-actions bot commented Jul 13, 2025

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "Feat/disable recording emails for guests". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@github-actions github-actions bot added cal video enterprise area: enterprise, audit log, organisation, SAML, SSO Medium priority Created by Linear-GitHub Sync ✨ feature New feature or request ❗️ migrations contains migration files labels Jul 13, 2025
@naaa760 naaa760 changed the title Feat/disable recording emails for guests feat: disable recording emails for guests Jul 13, 2025
cubic-dev-ai[bot]
cubic-dev-ai bot previously approved these changes Jul 13, 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.

cubic reviewed 14 files and found no issues. Review PR in cubic.dev.

Copy link

graphite-app bot commented Jul 13, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (07/13/25)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add community label" took an action on this PR • (07/13/25)

1 label was added to this PR based on Keith Williams's automation.

@kart1ka
Copy link
Contributor

kart1ka commented Jul 14, 2025

Hey @naaa760, thanks for the pr. Can you pls attach a loom video? There also seems to be a type check failing, can you fix that as well?

@naaa760
Copy link
Author

naaa760 commented Jul 14, 2025

@kart1ka

  • Turbo.json Fix:
    Successfully changed "pipeline" to "tasks" in turbo.json
    This resolves the turbo configuration issue that was preventing type checks

let me update you with loom video in some time.

quick-fix.sql Outdated
Comment on lines 2 to 6
SELECT t.id as team_id, t.name as team_name, t."isPlatform"
FROM "Team" t
JOIN "Membership" m ON t.id = m."teamId"
WHERE m.role IN ('ADMIN', 'OWNER');

Copy link
Contributor

Choose a reason for hiding this comment

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

Uncommit it

turbo.json Outdated
@@ -1,6 +1,6 @@
{
"$schema": "https://turborepo.org/schema.json",
"pipeline": {
"tasks": {
Copy link
Contributor

@anikdhabal anikdhabal Jul 14, 2025

Choose a reason for hiding this comment

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

Uncommit this change. This is not a part of the issue

Copy link
Contributor

@anikdhabal anikdhabal left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@anikdhabal anikdhabal left a comment

Choose a reason for hiding this comment

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

Fix the type error and also attach a loom video

@naaa760
Copy link
Author

naaa760 commented Jul 14, 2025

Hi @anikdhabal

Type Error: FIXED
I've identified and resolved the TypeScript type error. The issue was with the function signature and parameter handling in the email sending functions.

📹 Loom Video Update:
I'm currently facing dependency installation issues that prevent me from running the application locally for the demo video.

Could you please:

  1. Confirm if there's a preview deployment URL available for this PR?
  2. Or let me know if detailed screenshots showing the feature would be acceptable as an alternative?

The implementation is complete and type-safe. I can provide:

  • Screenshots of the new toggle in Cal Video settings
  • Code walkthrough showing the implementation
  • Database schema changes

Copy link
Contributor

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label Jul 29, 2025
Copy link
Contributor

coderabbitai bot commented Jul 29, 2025

Walkthrough

A new feature was implemented to allow disabling the sending of recording download emails to guests in the Cal Video integration. This includes updates across the backend, frontend, and database schema: a new boolean field (disableRecordingEmailsForGuests) was added to the relevant settings and types, a migration was created to add the field to the database, and the email sending logic was updated to conditionally skip guest emails based on this setting. The frontend now exposes a toggle for this option in the event type settings UI, and localization was updated for the new toggle label.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Assessment against linked issues

Objective Addressed Explanation
Add a setting to allow users to disable sending recording download emails to guests (#22255)
Ensure the backend respects the disable flag when sending emails to guests (#22255)
Update the frontend to allow toggling this setting in event type configuration (#22255)
Apply database and type changes to persist and propagate the new setting (#22255)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes were found. All modifications are directly related to the objective of allowing users to disable recording download emails for guests in Cal Video.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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: 4

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66397a6 and 3693038.

📒 Files selected for processing (13)
  • apps/web/app/api/recorded-daily-video/route.ts (1 hunks)
  • packages/emails/daily-video-emails.ts (1 hunks)
  • packages/emails/email-manager.ts (1 hunks)
  • packages/features/eventtypes/components/Locations.tsx (1 hunks)
  • packages/features/eventtypes/lib/types.ts (1 hunks)
  • packages/lib/server/locales/en/common.json (1 hunks)
  • packages/lib/server/repository/calVideoSettings.ts (3 hunks)
  • packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts (1 hunks)
  • packages/prisma/migrations/20250128000000_add_disable_recording_emails_for_guests/migration.sql (1 hunks)
  • packages/prisma/schema.prisma (1 hunks)
  • packages/prisma/zod/custom/eventtype.ts (1 hunks)
  • packages/trpc/server/routers/viewer/eventTypes/create.handler.ts (1 hunks)
  • packages/trpc/server/routers/viewer/eventTypes/types.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts

📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)

**/*.ts: For Prisma queries, only select data you need; never use include, always use select
Ensure the credential.key field is never returned from tRPC endpoints or APIs

Files:

  • packages/features/eventtypes/lib/types.ts
  • packages/trpc/server/routers/viewer/eventTypes/create.handler.ts
  • packages/trpc/server/routers/viewer/eventTypes/types.ts
  • apps/web/app/api/recorded-daily-video/route.ts
  • packages/prisma/zod/custom/eventtype.ts
  • packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts
  • packages/emails/email-manager.ts
  • packages/lib/server/repository/calVideoSettings.ts
  • packages/emails/daily-video-emails.ts
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)

Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js .utc() in hot paths like loops

Files:

  • packages/features/eventtypes/lib/types.ts
  • packages/trpc/server/routers/viewer/eventTypes/create.handler.ts
  • packages/trpc/server/routers/viewer/eventTypes/types.ts
  • apps/web/app/api/recorded-daily-video/route.ts
  • packages/prisma/zod/custom/eventtype.ts
  • packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts
  • packages/emails/email-manager.ts
  • packages/lib/server/repository/calVideoSettings.ts
  • packages/features/eventtypes/components/Locations.tsx
  • packages/emails/daily-video-emails.ts
**/*.tsx

📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)

Always use t() for text localization in frontend code; direct text embedding should trigger a warning

Files:

  • packages/features/eventtypes/components/Locations.tsx
🧠 Learnings (4)
packages/prisma/migrations/20250128000000_add_disable_recording_emails_for_guests/migration.sql (1)

Learnt from: vijayraghav-io
PR: #16579
File: packages/prisma/schema.prisma:149-153
Timestamp: 2025-07-16T07:14:49.248Z
Learning: In Cal.com's schema design, the team prefers to keep Boolean fields nullable (Boolean?) with defaults rather than making them non-nullable (Boolean) to avoid expensive database migrations that would update existing rows.

packages/prisma/schema.prisma (1)

Learnt from: vijayraghav-io
PR: #16579
File: packages/prisma/schema.prisma:149-153
Timestamp: 2025-07-16T07:14:49.248Z
Learning: In Cal.com's schema design, the team prefers to keep Boolean fields nullable (Boolean?) with defaults rather than making them non-nullable (Boolean) to avoid expensive database migrations that would update existing rows.

packages/lib/server/locales/en/common.json (1)

Learnt from: bandhan-majumder
PR: #22359
File: packages/lib/server/locales/en/common.json:1336-1339
Timestamp: 2025-07-14T16:31:45.233Z
Learning: When making localization changes for new features, it's often safer to add new strings rather than modify existing ones to avoid breaking existing functionality that depends on the original strings. This approach allows for feature-specific customization while maintaining backward compatibility.

packages/features/eventtypes/components/Locations.tsx (3)

Learnt from: alishaz-polymath
PR: #22304
File: packages/features/eventtypes/components/MultiplePrivateLinksController.tsx:92-94
Timestamp: 2025-07-16T06:42:27.024Z
Learning: In the MultiplePrivateLinksController component (packages/features/eventtypes/components/MultiplePrivateLinksController.tsx), the currentLink.maxUsageCount ?? 1 fallback in the openSettingsDialog function is intentional. Missing maxUsageCount values indicate old/legacy private links that existed before the expiration feature was added, and they should default to single-use behavior (1) for backward compatibility.

Learnt from: Anshumancanrock
PR: #22570
File: apps/web/modules/signup-view.tsx:253-253
Timestamp: 2025-07-21T21:33:23.371Z
Learning: In signup-view.tsx, when checking if redirectUrl contains certain strings, using explicit && checks (redirectUrl && redirectUrl.includes()) is preferred over optional chaining (redirectUrl?.includes()) to ensure the result is always a boolean rather than potentially undefined. This approach provides cleaner boolean contracts for downstream conditional logic.

Learnt from: hariombalhara
PR: #22547
File: packages/embeds/embed-core/src/lib/eventHandlers/scrollByDistanceEventHandler.ts:11-14
Timestamp: 2025-07-16T11:46:28.759Z
Learning: In Cal.com's embed system, internal events like "__scrollByDistance" are fired by Cal.com's own code, so runtime validation of event data structure is unnecessary since TypeScript type system guarantees type safety for internal events.

🪛 GitHub Actions: PR Update
apps/web/app/api/recorded-daily-video/route.ts

[error] 142-142: TypeScript error TS2322: Type 'number | null' is not assignable to type 'number | undefined'. Type 'null' is not assignable to type 'number | undefined' for property 'eventTypeId'.

packages/features/eventtypes/components/Locations.tsx

[error] 428-428: TypeScript error TS2551: Property 'disableRecordingEmailsForGuests' does not exist on type of 'calVideoSettings'. Did you mean 'disableRecordingForGuests'?

🔇 Additional comments (15)
packages/lib/server/locales/en/common.json (1)

29-29: New i18n key correctly added

Good call introducing a fresh key (disable_recording_emails_for_guests) rather than overloading the existing disable_recording_for_guests. This maintains backward compatibility and aligns with our localization guidelines.

packages/features/eventtypes/lib/types.ts (1)

165-165: LGTM!

The new optional boolean property is correctly typed and well-positioned within the calVideoSettings object. This provides proper TypeScript support for the new feature.

packages/trpc/server/routers/viewer/eventTypes/create.handler.ts (1)

75-75: LGTM!

The implementation correctly handles the new disableRecordingEmailsForGuests field with appropriate null coalescing to default to false. The pattern is consistent with other properties in the same object.

packages/prisma/zod/custom/eventtype.ts (1)

13-13: LGTM!

The Zod schema definition correctly validates the new field as an optional and nullable boolean, providing appropriate validation flexibility while maintaining consistency with the existing schema pattern.

packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts (1)

142-147: LGTM! Property addition follows established patterns.

The new disableRecordingEmailsForGuests property is properly decorated with validation and documentation annotations, consistent with other boolean properties in the CalVideoSettings class.

apps/web/app/api/recorded-daily-video/route.ts (2)

139-147: Good use of select instead of include.

The database query correctly follows the coding guideline by using select to only fetch the required disableRecordingEmailsForGuests field instead of including all fields.


150-154: LGTM! Proper parameter passing.

The function call correctly passes the fetched setting with a proper fallback to false, maintaining backward compatibility.

packages/trpc/server/routers/viewer/eventTypes/types.ts (1)

36-36: LGTM! Schema update follows established patterns.

The new disableRecordingEmailsForGuests field is properly added with consistent typing (optional and nullable boolean) matching other fields in the schema.

packages/emails/email-manager.ts (2)

731-735: LGTM! Function signature updated with proper defaults.

The new disableRecordingEmailsForGuests parameter is properly added with a default value of false, ensuring backward compatibility for existing callers.


739-751: Excellent implementation of conditional email sending.

The logic correctly implements the feature requirements:

  • Organizers always receive recording emails (line 740-742)
  • Guests only receive emails when disableRecordingEmailsForGuests is false (lines 745-751)

This ensures the organizer is never excluded while providing the option to disable guest notifications.

packages/lib/server/repository/calVideoSettings.ts (3)

22-22: LGTM! Consistent with existing pattern.

The new property follows the same optional boolean | null pattern as other Cal Video settings, which is appropriate for configuration flags.


34-34: LGTM! Proper null handling and placement.

The nullish coalescing operator ensures a concrete boolean value is stored in the database, preventing potential null-related issues. Good placement with other recording-related settings.


44-44: LGTM! Maintains create/update consistency.

The create operation mirrors the update operation exactly, ensuring consistent behavior regardless of whether the record exists. The false default preserves backward compatibility.

packages/emails/daily-video-emails.ts (2)

35-39: LGTM! Well-designed function signature.

The optional parameter with a default value of false maintains backward compatibility while clearly expressing the feature's intent. Good parameter naming and placement.


43-55: LGTM! Clear conditional logic with good separation of concerns.

The implementation correctly ensures organizers always receive recording emails while respecting the guest setting. Clear comments enhance readability.

Note: The sendDailyVideoTranscriptEmails function doesn't have similar conditional logic - verify if this is intentional or if transcript emails should also respect guest preferences.

Comment on lines +140 to +143
const calVideoSettings = await prisma.calVideoSettings.findUnique({
where: {
eventTypeId: booking.eventTypeId,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix TypeScript error: Handle null eventTypeId.

The pipeline failure indicates that booking.eventTypeId can be null, but the Prisma query expects a number. This will cause a runtime error.

Apply this fix to handle the null case:

+      if (!booking.eventTypeId) {
+        // If no eventTypeId, default to false (send emails to guests)
+        await sendDailyVideoRecordingEmails(evt, downloadLink, false);
+        return NextResponse.json({ message: "Success" });
+      }
+
       // Get Cal Video settings to check if recording emails for guests are disabled
       const calVideoSettings = await prisma.calVideoSettings.findUnique({
         where: {
           eventTypeId: booking.eventTypeId,
         },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const calVideoSettings = await prisma.calVideoSettings.findUnique({
where: {
eventTypeId: booking.eventTypeId,
},
if (!booking.eventTypeId) {
// If no eventTypeId, default to false (send emails to guests)
await sendDailyVideoRecordingEmails(evt, downloadLink, false);
return NextResponse.json({ message: "Success" });
}
// Get Cal Video settings to check if recording emails for guests are disabled
const calVideoSettings = await prisma.calVideoSettings.findUnique({
where: {
eventTypeId: booking.eventTypeId,
},
🧰 Tools
🪛 GitHub Actions: PR Update

[error] 142-142: TypeScript error TS2322: Type 'number | null' is not assignable to type 'number | undefined'. Type 'null' is not assignable to type 'number | undefined' for property 'eventTypeId'.

🤖 Prompt for AI Agents
In apps/web/app/api/recorded-daily-video/route.ts around lines 140 to 143, the
Prisma query uses booking.eventTypeId which can be null, causing a TypeScript
error and potential runtime issue. Fix this by adding a check before the query
to ensure booking.eventTypeId is not null; if it is null, handle that case
appropriately (e.g., skip the query or return early). This prevents passing null
to the Prisma where clause expecting a number.

Comment on lines +426 to +439
<Controller
name="calVideoSettings.disableRecordingEmailsForGuests"
defaultValue={!!eventType.calVideoSettings?.disableRecordingEmailsForGuests}
render={({ field: { onChange, value } }) => {
return (
<SettingsToggle
title={t("disable_recording_emails_for_guests")}
labelClassName="text-sm leading-6 whitespace-normal break-words"
checked={value}
onCheckedChange={onChange}
/>
);
}}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Good implementation pattern but fix TypeScript error.

The new toggle follows the established pattern of other CalVideo settings toggles and correctly uses t() for localization as required by the coding guidelines.

However, the pipeline failure indicates a TypeScript error where disableRecordingEmailsForGuests doesn't exist on the calVideoSettings type.

Ensure that the FormValues type in packages/features/eventtypes/lib/types.ts includes this new property in the calVideoSettings interface, or verify that all related type definitions have been updated consistently across the codebase.

🧰 Tools
🪛 GitHub Actions: PR Update

[error] 428-428: TypeScript error TS2551: Property 'disableRecordingEmailsForGuests' does not exist on type of 'calVideoSettings'. Did you mean 'disableRecordingForGuests'?

🤖 Prompt for AI Agents
In packages/features/eventtypes/components/Locations.tsx around lines 426 to
439, the TypeScript error occurs because the property
disableRecordingEmailsForGuests is missing from the calVideoSettings type. To
fix this, update the FormValues type definition in
packages/features/eventtypes/lib/types.ts by adding
disableRecordingEmailsForGuests as a boolean property to the calVideoSettings
interface. Also, verify that any other related type definitions referencing
calVideoSettings are updated accordingly to maintain consistency across the
codebase.

@@ -0,0 +1 @@
ALTER TABLE "CalVideoSettings" ADD COLUMN "disableRecordingEmailsForGuests" BOOLEAN NOT NULL DEFAULT false;
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider using nullable Boolean field following team preferences.

Based on Cal.com's established schema design patterns, the team prefers nullable Boolean fields (Boolean?) with defaults rather than non-nullable fields to avoid expensive database migrations that update existing rows.

Consider changing the migration to:

-ALTER TABLE "CalVideoSettings" ADD COLUMN     "disableRecordingEmailsForGuests" BOOLEAN NOT NULL DEFAULT false;
+ALTER TABLE "CalVideoSettings" ADD COLUMN     "disableRecordingEmailsForGuests" BOOLEAN DEFAULT false;

This approach aligns with the team's preference and avoids the cost of updating all existing rows during migration.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ALTER TABLE "CalVideoSettings" ADD COLUMN "disableRecordingEmailsForGuests" BOOLEAN NOT NULL DEFAULT false;
ALTER TABLE "CalVideoSettings" ADD COLUMN "disableRecordingEmailsForGuests" BOOLEAN DEFAULT false;
🤖 Prompt for AI Agents
In
packages/prisma/migrations/20250128000000_add_disable_recording_emails_for_guests/migration.sql
at line 1, the new column disableRecordingEmailsForGuests is added as a
non-nullable Boolean with a default false. To align with team preferences and
avoid costly updates on existing rows, change the column to be nullable Boolean
(allow NULL values) with a default false instead. Modify the ALTER TABLE
statement to add the column as nullable with the default, so existing rows are
not updated during migration.

@@ -78,6 +78,7 @@ model CalVideoSettings {
redirectUrlOnExit String?
disableTranscriptionForGuests Boolean @default(false)
disableTranscriptionForOrganizer Boolean @default(false)
disableRecordingEmailsForGuests Boolean @default(false)
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Follow team preference for nullable Boolean fields.

The new field uses a non-nullable Boolean, but Cal.com's established schema design pattern prefers nullable Boolean fields with defaults to avoid expensive database migrations.

Consider changing to:

-  disableRecordingEmailsForGuests  Boolean @default(false)
+  disableRecordingEmailsForGuests  Boolean? @default(false)

This approach aligns with the team's preference and avoids costly row updates during migration.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
disableRecordingEmailsForGuests Boolean @default(false)
disableRecordingEmailsForGuests Boolean? @default(false)
🤖 Prompt for AI Agents
In packages/prisma/schema.prisma at line 81, the field
disableRecordingEmailsForGuests is defined as a non-nullable Boolean with a
default value. To follow the team's preference and avoid expensive database
migrations, change this field to a nullable Boolean with a default value
instead. Update the schema to make the field Boolean? with @default(false) so it
aligns with the established pattern and reduces migration costs.

@kart1ka
Copy link
Contributor

kart1ka commented Jul 29, 2025

@naaa760 Can you pls resolve the merge conflicts and attach a loom video?

@kart1ka kart1ka marked this pull request as draft July 29, 2025 03:17
@github-actions github-actions bot removed the Stale label Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cal video community Created by Linear-GitHub Sync enterprise area: enterprise, audit log, organisation, SAML, SSO ✨ feature New feature or request Medium priority Created by Linear-GitHub Sync ❗️ migrations contains migration files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable sending recording download emails
4 participants