Skip to content

fix(packages/app-store): exclude cancelled events and filter by date range in getAvailability#28743

Open
zhyd1997 wants to merge 2 commits intocalcom:mainfrom
zhyd1997:claude/fix-issue-23391-PrHin
Open

fix(packages/app-store): exclude cancelled events and filter by date range in getAvailability#28743
zhyd1997 wants to merge 2 commits intocalcom:mainfrom
zhyd1997:claude/fix-issue-23391-PrHin

Conversation

@zhyd1997
Copy link
Copy Markdown
Contributor

@zhyd1997 zhyd1997 commented Apr 4, 2026

Fixes two bugs in the ICS feed calendar service that caused false-positive busy times, resulting in "No available users found" errors for users with multiple calendar connections (e.g. Proton + Google Calendar via ICS feed).

  1. Skip events with STATUS:CANCELLED - cancelled/declined meetings in ICS feeds were incorrectly counted as busy time, blocking otherwise free slots.

  2. Filter non-recurring events by dateFrom/dateTo - unlike recurring events (which already filtered by range), non-recurring events were all returned regardless of whether they fell within the requested window.

Adds tests covering both behaviours.

https://claude.ai/code/session_01QKRwyaEnVrG3HLW1hRzGtG

What does this PR do?

Visual Demo (For contributors especially)

A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).

Video Demo (if applicable):

  • Show screen recordings of the issue or feature.
  • Demonstrate how to reproduce the issue, the behavior before and after the change.

Image Demo (if applicable):

  • Add side-by-side screenshots of the original and updated change.
  • Highlight any significant change(s).

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.
  • 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?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings
  • My PR is too large (>500 lines or >10 files) and should be split into smaller PRs

Open with Devin

…etAvailability

Fixes two bugs in the ICS feed calendar service that caused false-positive
busy times, resulting in "No available users found" errors for users with
multiple calendar connections (e.g. Proton + Google Calendar via ICS feed).

1. Skip events with STATUS:CANCELLED - cancelled/declined meetings in ICS
   feeds were incorrectly counted as busy time, blocking otherwise free slots.

2. Filter non-recurring events by dateFrom/dateTo - unlike recurring events
   (which already filtered by range), non-recurring events were all returned
   regardless of whether they fell within the requested window.

Adds tests covering both behaviours.

Fixes calcom#23391

https://claude.ai/code/session_01QKRwyaEnVrG3HLW1hRzGtG
@zhyd1997 zhyd1997 requested a review from a team as a code owner April 4, 2026 21:37
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions bot added bookings area: bookings, availability, timezones, double booking foundation High priority Created by Linear-GitHub Sync 🐛 bug Something isn't working labels Apr 4, 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

…oundary

Follow-up from Opus 4.6 code review of the fix for issue calcom#23391.

- Hoist rangeStart/rangeEnd dayjs objects outside the vevents.forEach loop
  so they are constructed once per getAvailability call instead of per-event.

- Fix all-day event boundary: change overlap filter from strict isBefore to
  !isAfter, matching RFC 5545 §3.6.1 exclusive DTEND semantics. An April 3
  all-day event has DTEND = April 4 00:00 UTC which equalled dateFrom and
  was incorrectly included in the range.

- Add 4 new tests: all-day event in range, all-day event out of range,
  multi-day event spanning entire range, STATUS:TENTATIVE treated as busy.

https://claude.ai/code/session_01QKRwyaEnVrG3HLW1hRzGtG
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@romitg2 romitg2 added ready-for-e2e run-ci Approve CI to run for external contributors labels Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bookings area: bookings, availability, timezones, double booking 🐛 bug Something isn't working foundation High priority Created by Linear-GitHub Sync ready-for-e2e run-ci Approve CI to run for external contributors size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Booking an appointment in a free slot returns "The appointment could not be booked. No available users found. Can you try another time slot?"

4 participants