Skip to content

fix: prevent CalDAV duplicate invitations with RFC-compliant SCHEDULE-AGENT#22434

Merged
anikdhabal merged 11 commits intocalcom:mainfrom
yuvrajangadsingh:fix/caldav-duplicate-invites
Jan 22, 2026
Merged

fix: prevent CalDAV duplicate invitations with RFC-compliant SCHEDULE-AGENT#22434
anikdhabal merged 11 commits intocalcom:mainfrom
yuvrajangadsingh:fix/caldav-duplicate-invites

Conversation

@yuvrajangadsingh
Copy link
Copy Markdown
Contributor

@yuvrajangadsingh yuvrajangadsingh commented Jul 11, 2025

Summary

Fixes #9485

Adds SCHEDULE-AGENT=CLIENT to ATTENDEE lines in CalDAV createEvent and updateEvent operations per RFC 6638 Section 7.1. This tells CalDAV servers (Fastmail, NextCloud, etc.) that the client handles scheduling, preventing duplicate invitation emails.

Implementation Details

This implementation includes full RFC compliance:

  • RFC 5545 line folding: Lines exceeding 75 octets are properly folded with CRLF + space
  • UTF-8 aware byte counting: Correctly handles international characters in attendee names
  • Proper ATTENDEE parsing: Handles :mailto: format correctly
  • Idempotent: Skips lines that already have SCHEDULE-AGENT parameter

What Changed

  • Added foldLine() helper for RFC 5545 compliant line folding
  • Added addScheduleAgentClient() helper that adds the parameter with proper folding
  • Applied to both createEvent and updateEvent in CalendarService.ts

Test Plan

  • Create CalDAV event with attendees - verify no duplicate emails from server
  • Update CalDAV event - verify no duplicate emails
  • Test with long attendey names (international characters) - verify line folding works
  • Verify existing SCHEDULE-AGENT parameters are preserved

/claim #9485

@vercel
Copy link
Copy Markdown

vercel bot commented Jul 11, 2025

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

A member of the Team first needs to authorize it.

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

CLAassistant commented Jul 11, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added $500 caldav area: caldav, fastmail, Baïkal, Kerio, mailbox, nextcloud Low priority Created by Linear-GitHub Sync 🐛 bug Something isn't working 💎 Bounty A bounty on Algora.io labels Jul 11, 2025
@dosubot dosubot bot added the automated-tests area: unit tests, e2e tests, playwright label Jul 11, 2025
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.

cubic found 3 issues across 2 files. Review them in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

@graphite-app
Copy link
Copy Markdown

graphite-app bot commented Jul 11, 2025

Graphite Automations

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

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

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

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

"Add ready-for-e2e label" took an action on this PR • (07/12/25)

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

@yuvrajangadsingh
Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai /review

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai bot commented Jul 11, 2025

@yuvrajangadsingh I've started the AI code review. It'll take a few minutes to complete.

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.

cubic found 4 issues across 2 files. Review them in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

@yuvrajangadsingh
Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai /review

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai bot commented Jul 11, 2025

@yuvrajangadsingh I've started the AI code review. It'll take a few minutes to complete.

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.

cubic found 1 issue across 2 files. Review it in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

@yuvrajangadsingh
Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai /review

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai bot commented Jul 11, 2025

@yuvrajangadsingh I've started the AI code review. It'll take a few minutes to complete.

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.

cubic found 1 issue across 2 files. Review it in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

@yuvrajangadsingh
Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai /review

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai bot commented Jul 11, 2025

@yuvrajangadsingh I've started the AI code review. It'll take a few minutes to complete.

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.

cubic found 1 issue across 2 files. Review it in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

@yuvrajangadsingh
Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai /review

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai bot commented Jul 11, 2025

@yuvrajangadsingh I've started the AI code review. It'll take a few minutes to complete.

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.

cubic found 1 issue across 2 files. Review it in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

@yuvrajangadsingh
Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai /review

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai bot commented Jul 12, 2025

@yuvrajangadsingh I've started the AI code review. It'll take a few minutes to complete.

cubic-dev-ai[bot]
cubic-dev-ai bot previously approved these changes Jul 12, 2025
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.

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

@github-actions github-actions bot added the ❗️ .env changes contains changes to env variables label Jan 21, 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.

1 issue found across 3 files (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name=".env.example">

<violation number="1" location=".env.example:262">
P3: Gmail SMTP password example includes an extraneous trailing character `G`, producing a wrong value if copied from the template.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@anikdhabal anikdhabal added the run-ci Approve CI to run for external contributors label Jan 21, 2026
Copy link
Copy Markdown
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.

Thanks for your work

@yuvrajangadsingh
Copy link
Copy Markdown
Contributor Author

Thanks @anikdhabal for reviewing and merging! Really appreciate the time you put into this.

@GhostDragonAlpha

This comment was marked as off-topic.

@saschafoerster
Copy link
Copy Markdown
Contributor

I just tested it with "Kerio", connected via CalDAV. Kerio still sends a secondary invitation. What makes this bad is that the timezone is different in the mails from Cal.com and from Kerio calendar invitation, so poeple show up to GMT, when they should be in Europe/Berlin timezone.

Bildschirmfoto 2026-01-25 um 13 04 25 Bildschirmfoto 2026-01-25 um 13 04 19

Maybe in relation to https://github.com/calcom/cal.com/discussions/24473

@laz-001

This comment was marked as off-topic.

@yuvrajangadsingh
Copy link
Copy Markdown
Contributor Author

@PeerRich @keithwillcode My PR #22434 was merged and closed issue #9485. I forgot to include /claim #9485 in the PR body at the time. Could you please manually award the $500 bounty? Thank you!

@anikdhabal
Copy link
Copy Markdown
Contributor

@yuvrajangadsingh We will ask our team to tip you, but this isn't a complete fix—it looks like two remaining issues were not addressed. Please check this: #28112

Kindly try to address them in the best possible way in a separate pr

@yuvrajangadsingh
Copy link
Copy Markdown
Contributor Author

@anikdhabal done — opened #28115 addressing both remaining issues (UID consistency + missing VTIMEZONE). thanks for flagging #28112, used it as reference for the fixes.

@PeerRich
Copy link
Copy Markdown
Member

/tip 500

@algora-pbc algora-pbc bot added the 💰 Rewarded Rewarded bounties on Algora.io label Feb 21, 2026
@algora-pbc
Copy link
Copy Markdown

algora-pbc bot commented Feb 21, 2026

🎉🎈 @yuvrajangadsingh has been awarded $500 by Cal.com, Inc.! 🎈🎊

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

Labels

automated-tests area: unit tests, e2e tests, playwright 🙋 Bounty claim 💎 Bounty A bounty on Algora.io 🐛 bug Something isn't working caldav area: caldav, fastmail, Baïkal, Kerio, mailbox, nextcloud community Created by Linear-GitHub Sync ❗️ .env changes contains changes to env variables Low priority Created by Linear-GitHub Sync ready-for-e2e 💰 Rewarded Rewarded bounties on Algora.io run-ci Approve CI to run for external contributors size/L Stale $500

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CalDAV integration with Fastmail is generating duplicate, erroneous invitation emails.

8 participants