From 03533577ee94bdaa40ea12113c955f5ee34fa434 Mon Sep 17 00:00:00 2001 From: Callum Macdonald Date: Wed, 17 Jun 2026 20:39:20 +0200 Subject: [PATCH] Don't queue if sync is disabled - fix #2040 --- src/services/TaskCalendarSyncService.ts | 11 +++++++++-- src/services/task-service/TaskCreationService.ts | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/services/TaskCalendarSyncService.ts b/src/services/TaskCalendarSyncService.ts index cc4076bb..a86845aa 100644 --- a/src/services/TaskCalendarSyncService.ts +++ b/src/services/TaskCalendarSyncService.ts @@ -766,6 +766,10 @@ export class TaskCalendarSyncService { return true; } + if (!this.plugin.settings.googleCalendarExport.enabled) { + return true; + } + if (!this.isDeletionQueueReady()) { await this.queueCalendarDeletion( taskPath, @@ -970,7 +974,7 @@ export class TaskCalendarSyncService { if (this.isTaskCalendarEligible(task)) { this.profileIncrement("handleExternalTaskFileUpdated.changedEligibleTask"); - if (settings.syncOnTaskCreate) { + if (settings.enabled && settings.syncOnTaskCreate) { await this.syncTaskToCalendar(task); } else { await this.recordCalendarSyncFingerprint(task); @@ -2430,7 +2434,10 @@ export class TaskCalendarSyncService { try { if (!this.isEnabled()) { - if (queueOnFailure) { + if (queueOnFailure && settings.enabled) { + // Only queue if sync is enabled but temporarily not ready + // (e.g. no calendar selected yet, or OAuth not connected). + // When enabled=false the user hasn't opted in, so don't populate the queue. await this.queueTaskSync( task.path, new Error("Google Calendar sync is not ready") diff --git a/src/services/task-service/TaskCreationService.ts b/src/services/task-service/TaskCreationService.ts index a253737c..ecc91d36 100644 --- a/src/services/task-service/TaskCreationService.ts +++ b/src/services/task-service/TaskCreationService.ts @@ -360,6 +360,7 @@ export class TaskCreationService { if ( runtime.taskCalendarSyncService && + runtime.settings.googleCalendarExport.enabled && runtime.settings.googleCalendarExport.syncOnTaskCreate ) { runtime.taskCalendarSyncService.syncTaskToCalendar(taskInfo).catch((error) => {