Skip to content

Commit a82d77d

Browse files
committed
Fixed: Skip creating cancelled events on initial sync
1 parent df93091 commit a82d77d

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

.changeset/chilly-symbols-help.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@plotday/tool-outlook-calendar": patch
3+
"@plotday/tool-google-calendar": patch
4+
---
5+
6+
Fixed: Skip creating cancelled events on initial sync

tools/google-calendar/src/google-calendar.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,10 @@ export class GoogleCalendar
696696

697697
// Handle cancelled events
698698
if (event.status === "cancelled") {
699+
// On initial sync, skip creating activities for already-cancelled events
700+
if (initialSync) {
701+
continue;
702+
}
699703
// Canonical source for this event (required for upsert)
700704
const canonicalUrl = `google-calendar:${event.id}`;
701705

tools/outlook-calendar/src/outlook-calendar.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,10 @@ export class OutlookCalendar
475475
try {
476476
// Handle deleted events
477477
if (outlookEvent["@removed"]) {
478+
// On initial sync, skip creating activities for already-deleted events
479+
if (initialSync) {
480+
continue;
481+
}
478482
// Build source URL using event ID
479483
const source = `outlook-calendar:${outlookEvent.id}`;
480484

@@ -551,6 +555,11 @@ export class OutlookCalendar
551555
continue;
552556
}
553557

558+
// On initial sync, skip cancelled standalone events
559+
if (initialSync && outlookEvent.isCancelled) {
560+
continue;
561+
}
562+
554563
// For recurring events, DON'T add tags at series level
555564
// Tags (RSVPs) should be per-occurrence via the occurrences array
556565
// For non-recurring events, add tags normally

0 commit comments

Comments
 (0)