diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-30 15:12:12 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-30 15:12:12 -0400 |
| commit | d5e9451022e9254655cc67e015f9d331414d2d76 (patch) | |
| tree | f19e4572fb65ea698ad6c44005e4f905c214f2dd /tests/test-calendar-sync--parse-exception-event.el | |
| parent | 11e45bee9f101e998131d2938a778c5f52887131 (diff) | |
| download | dotemacs-d5e9451022e9254655cc67e015f9d331414d2d76.tar.gz dotemacs-d5e9451022e9254655cc67e015f9d331414d2d76.zip | |
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.
Diffstat (limited to 'tests/test-calendar-sync--parse-exception-event.el')
| -rw-r--r-- | tests/test-calendar-sync--parse-exception-event.el | 22 |
1 files changed, 22 insertions, 0 deletions
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 () |
