From d5e9451022e9254655cc67e015f9d331414d2d76 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 30 Jun 2026 15:12:12 -0400 Subject: fix(calendar-sync): drop singly-declined recurring occurrences Declining one occurrence of a recurring meeting left it on the agenda. Google emits that decline as a RECURRENCE-ID override carrying the user's PARTSTAT=DECLINED. But calendar-sync--parse-exception-event never read the override's attendee block, so the occurrence kept the series' inherited "accepted" status and the declined filter never dropped it. The apply side already re-derives status from an override's attendees. The parse side just wasn't supplying them. The fix parses the override's ATTENDEE lines into :attendees, the same way parse-event does. A unit test covers the extraction. An integration test runs the full parse/apply/filter chain on a declined week. --- tests/test-calendar-sync--parse-exception-event.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/test-calendar-sync--parse-exception-event.el') diff --git a/tests/test-calendar-sync--parse-exception-event.el b/tests/test-calendar-sync--parse-exception-event.el index 1935d3eb..a26a7418 100644 --- a/tests/test-calendar-sync--parse-exception-event.el +++ b/tests/test-calendar-sync--parse-exception-event.el @@ -47,6 +47,28 @@ (event (test-calendar-sync-make-vevent "Regular Event" start end))) (should-not (calendar-sync--parse-exception-event event)))) +;;; Normal Cases — attendee extraction (singly-declined occurrence) + +(ert-deftest test-calendar-sync--parse-exception-event-extracts-attendees () + "Normal: a RECURRENCE-ID override carrying an ATTENDEE block parses :attendees, +so a singly-declined occurrence can have its user status re-derived downstream +by `calendar-sync--apply-single-exception'." + (let* ((start (test-calendar-sync-time-days-from-now 7 10 0)) + (end (test-calendar-sync-time-days-from-now 7 11 0)) + (event (concat "BEGIN:VEVENT\n" + "UID:override@google.com\n" + "RECURRENCE-ID:20260203T090000Z\n" + "SUMMARY:1:1 with Hayk\n" + "ATTENDEE;CN=Craig;PARTSTAT=DECLINED:mailto:craig@example.com\n" + "DTSTART:" (test-calendar-sync-ics-datetime start) "\n" + "DTEND:" (test-calendar-sync-ics-datetime end) "\n" + "END:VEVENT")) + (plist (calendar-sync--parse-exception-event event)) + (attendees (plist-get plist :attendees))) + (should attendees) + (should (equal "craig@example.com" (plist-get (car attendees) :email))) + (should (equal "DECLINED" (plist-get (car attendees) :partstat))))) + ;;; Error Cases (ert-deftest test-calendar-sync--parse-exception-event-error-unparseable-times () -- cgit v1.2.3