Skip to content

fix(caldav): allow same base URL with different credentials and dedupe by full identity#28725

Open
AJ0070 wants to merge 2 commits intocalcom:mainfrom
AJ0070:fix/28678
Open

fix(caldav): allow same base URL with different credentials and dedupe by full identity#28725
AJ0070 wants to merge 2 commits intocalcom:mainfrom
AJ0070:fix/28678

Conversation

@AJ0070
Copy link
Copy Markdown

@AJ0070 AJ0070 commented Apr 3, 2026

What does this PR do?

This PR fixes CalDAV account installation so multiple accounts can be added when they share the same base CalDAV URL but use different credentials.

Changes included

  • Updated CalDAV add logic to compare full credential identity (url + username + password), not URL alone.
  • Added idempotent handling for exact duplicate credentials (same url, username, password) to avoid duplicate records.
  • Preserved valid behavior for same URL with different credentials by allowing creation of a new credential.
  • Added regression tests for both scenarios above.

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.
    N/A (no docs change needed; behavior bugfix only).
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
    CALENDSO_ENCRYPTION_KEY must be set (test uses a stubbed value).

  • What are the minimal test data to have?

    • A logged-in user
    • Existing CalDAV credential with:
      • url: shared base URL
      • username/password A
  • What is expected (happy path) to have (input and output)?

    • Input 1: same URL with username/password B
      • Output 1: request succeeds and creates a new credential.
    • Input 2: same URL with same username/password A
      • Output 2: request succeeds idempotently without creating a second identical credential.
  • Any other important info that could help to test that PR

    • Automated regression test command used:
      corepack yarn vitest run add.test.ts
    • Lint command used on touched files:
      corepack yarn biome check add.ts add.test.ts

Checklist

@AJ0070 AJ0070 requested a review from a team as a code owner April 3, 2026 10:27
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 3, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the 🐛 bug Something isn't working label Apr 3, 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.

No issues found across 2 files

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/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CalDav - same caldav base URL, different login credentials do not work

2 participants