Skip to content

Fix Google Calendar task sync reliability and rendering#1851

Open
martin-forge wants to merge 10 commits intocallumalpass:mainfrom
martin-forge:martin-forge/google-calendar-fixes
Open

Fix Google Calendar task sync reliability and rendering#1851
martin-forge wants to merge 10 commits intocallumalpass:mainfrom
martin-forge:martin-forge/google-calendar-fixes

Conversation

@martin-forge
Copy link
Copy Markdown
Contributor

@martin-forge martin-forge commented Apr 30, 2026

Summary

This combines the Google Calendar fixes from #1802, #1832, #1843, and #1844 into one PR. I think they are easier to review together because they touch the same sync path and share metadata assumptions.

  • Recurring task reschedules now keep one master event and one detached exception event, with EXDATEs for moved and completed instances.
  • Hardened moved recurring occurrence handling so stale exception metadata cannot replace the true original series date when an on-pattern scheduled occurrence is moved.
  • TaskCard scheduled-date actions now preserve the clicked recurring occurrence context before updating scheduled, preventing duplicate recurring/detached projections when moving one instance from the card UI.
  • Task property writes now map underscored TaskInfo keys such as recurrence_anchor, complete_instances, and skipped_instances to their configured frontmatter fields instead of producing undefined keys.
  • Checkbox-backed boolean status updates are normalized for completed-date, auto-archive, webhook, and Google Calendar side effects while preserving boolean frontmatter for Obsidian checkbox properties.
  • Zero-duration timed Google events get a minimal end time before FullCalendar list rendering, which prevents the multi-day display bug.
  • Task deletions and failed sync writes are queued in plugin data and replayed after reconnect or restart; 404/410 deletes are treated as already clean.
  • Create/update/status races are serialized or deduped so duplicate events and overwritten completion ticks are avoided.
  • External task-file changes now reconcile to Google Calendar through persisted calendar-relevant fingerprints, including first-startup reconciliation for already-linked tasks and later linked-task changes made while Obsidian was closed, without startup bulk creation for existing unlinked tasks.
  • External task completions now reconcile with the auto-archive queue: live or offline file edits that move a task into an auto-archiving status are queued using completion/file timestamps, due archives are processed, existing timers are not reset, and archived linked tasks stay queued until Google cleanup succeeds.
  • Calendar descriptions are plain text: wikilinks render as labels, and the Obsidian URL is included as text instead of an HTML anchor. This avoids raw HTML in Apple Calendar; whether it is clickable still depends on the calendar client.

Validation

  • npm test -- --runInBand tests/unit/issues/issue-google-calendar-delete-retry-queue.test.ts tests/unit/issues/issue-google-calendar-duplicate-investigation.test.ts tests/unit/issues/issue-1696-gcal-recurring-reschedule.test.ts tests/unit/issues/issue-google-calendar-external-file-reconciliation.test.ts tests/unit/issues/issue-google-calendar-archive-reliability.test.ts tests/unit/issues/issue-1695-archived-task-orphaned-calendar-event.test.ts tests/unit/issues/issue-1687-calendar-recreate-date-preservation.test.ts tests/unit/issues/issue-1823-zero-duration-google-calendar-list-duplication.test.ts
  • npm test -- --runInBand tests/unit/services/TaskService.test.ts tests/unit/issues/issue-850-auto-archive-checkbox-status.test.ts
  • npm test -- --runInBand tests/unit/issues/issue-google-calendar-archive-reliability.test.ts tests/unit/issues/issue-1696-gcal-recurring-reschedule.test.ts
  • npm run typecheck
  • npm run build
  • TZ=UTC npm test -- --runInBand
  • git diff --check

Note: a non-UTC local timezone check still reproduces the same two pre-existing timezone-sensitive failures in due-date-timezone-inconsistency.test.ts and issue-327-failing-test.test.ts; the UTC run passes.

@martin-forge martin-forge force-pushed the martin-forge/google-calendar-fixes branch from ca81b1e to 5ff79ac Compare April 30, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant