Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/releases/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ Example:

## Fixed

- (#1921) Fixed Google Calendar and auto-archive side effects falling stale after direct task file edits.
- Reconciles lifecycle-relevant frontmatter changes through the existing task file update event, with a first-run fingerprint baseline to avoid bulk startup API writes.
- (#1911) Fixed recurrence choices starting from today instead of the selected calendar date when creating a task from Calendar view.
- Thanks to @mikhailmarka for reporting.
23 changes: 23 additions & 0 deletions src/bootstrap/pluginBootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import { EVENT_USER_NOTICE, type UserNoticePayload } from "../core/userNotices";
const tasknotesLogger = createTaskNotesLogger({ tag: "Bootstrap/PluginBootstrap" });

type FileDeletedEventData = { path: string; prevCache?: unknown };
type FileUpdatedEventData = { path: string; file?: unknown; updatedTask?: TaskInfo };

type EditorWithCodeMirror = {
cm?: unknown;
Expand Down Expand Up @@ -343,8 +344,30 @@ export function initializeServicesLazily(plugin: TaskNotesPlugin): void {
plugin.taskCalendarSyncService = new (
await import("../services/TaskCalendarSyncService")
).TaskCalendarSyncService(plugin, plugin.googleCalendarService);
await plugin.taskCalendarSyncService.initializeExternalFileReconciliation();
plugin.taskCalendarSyncService.startRecoveryQueueProcessor();

plugin.registerEvent(
plugin.emitter.on("file-updated", (data: FileUpdatedEventData) => {
if (!plugin.taskCalendarSyncService || !data?.path) {
return;
}

plugin.taskCalendarSyncService
.handleExternalTaskFileUpdated(data.path, data.updatedTask)
.catch((error) => {
tasknotesLogger.warn(
"Failed to reconcile externally updated task with Google Calendar:",
{
category: "provider",
operation: "reconcile-external-task-file-update",
error: error,
}
);
});
})
);

plugin.registerEvent(
plugin.emitter.on("file-deleted", (data: FileDeletedEventData) => {
if (!plugin.taskCalendarSyncService) {
Expand Down
Loading
Loading