Skip to content

Fix recurring tasks missing scheduled date when recurrence is saved - #2202

Open
christenbc wants to merge 2 commits into
callumalpass:mainfrom
christenbc:fix/missing-scheduled-date-for-recurrences
Open

Fix recurring tasks missing scheduled date when recurrence is saved#2202
christenbc wants to merge 2 commits into
callumalpass:mainfrom
christenbc:fix/missing-scheduled-date-for-recurrences

Conversation

@christenbc

@christenbc christenbc commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Ensure a scheduled date is set whenever recurrence is saved, including when the custom recurrence start date is left empty
  • Centralize recurrence scheduling defaults in getRecurrenceSchedulingDefaults() and resolveScheduledDateForRecurrence()
  • Apply the same logic on task creation and recurrence updates so Google Calendar sync has a date to work with

Problem

Recurring tasks could be saved with a recurrence rule (and sometimes an auto-filled DTSTART) but no scheduled date. TaskNotes could still calculate recurrence internally, but Google Calendar export requires scheduled/due and would skip these tasks.

This was easy to hit from the custom recurrence dialog when only the repeat pattern was set (e.g. monthly on the 4th) without an explicit start date.

Solution

When recurrence is saved and the task has no scheduled date:

  1. Compute the next occurrence from the recurrence rule
  2. Fall back to dateCreated if needed
  3. Continue to add DTSTART when missing (existing behavior)

Test plan

  • Create a recurring task with no scheduled date and no custom recurrence start date; confirm scheduled is written to frontmatter
  • Update an existing task to add recurrence without a start date; confirm scheduled is set
  • With Google Calendar export enabled, confirm the task syncs as a recurring event
  • Confirm tasks that already have scheduled are unchanged
  • Run npm test -- --testPathPatterns=taskUpdatePlanning

@christenbc christenbc changed the title fix recurrence save setting scheduled date for calendar sync Fix recurring tasks missing scheduled date when recurrence is saved Aug 6, 2026
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