Skip to content

fix(recurrence): narrow reschedule-clear rule for scheduled-anchored tasks (#2691) - #2724

Merged
callumalpass merged 2 commits into
mainfrom
fix/2691-narrow-reschedule-clear
Nov 26, 2026
Merged

callumalpass merged 2 commits into
mainfrom
fix/2691-narrow-reschedule-clear

Conversation

@callumalpass

Copy link
Copy Markdown
Owner

Summary

Implements the narrower recurring reschedule-clear rule in TaskService.updateProperty for scheduled-anchored recurring tasks (Refs #2691):

  • Previously, changing a recurring task's scheduled date cleared every completed and skipped instance on or after the new date (feat(completion): explicit completion-date control menu #2147). Because moved occurrences now preserve their original rule date in recurrence_original_date ([Bug]: Calendar shows both dates after rescheduling a virtual recurring task #2396), this wiped unrelated occurrences' history (e.g. moving 22 Nov to 21 Nov cleared a skip on 29 Nov, and moving it to 15 Nov cleared 15 Nov's completion).
  • For scheduled-anchored recurring tasks:
    • Moving an occurrence that carries a rule identity (recurrence_original_date, including returning it to its original date) clears nothing.
    • Moving an occurrence without a recurrence_original_date (such as a Google Calendar-synced task or a legacy off-pattern note without a marker) clears only the landing day when that day is already in complete_instances or skipped_instances, leaving earlier and later history intact and still behind confirmClearInstances.
  • Completion-anchored recurring tasks remain unchanged (still clearing recorded instances >= new date behind confirmation).
  • Updated docs/features/recurring-tasks.md and docs/releases/unreleased.md.

Companion change in @tasknotes/model: callumalpass/tasknotes-model#35 (merged). Calendar drags via TaskService.applyCalendarEdit will inherit the updated planCalendarEdit once @tasknotes/model is released and bumped in package.json.

Testing

  • Added tests/unit/issues/issue-2691-reschedule-clear-rule.test.ts (real rrule engine) covering scheduled-anchored native moves, already-moved/returned occurrences, Google-synced tasks, legacy off-pattern notes, and completion-anchored tasks (including confirmation accept/decline).
  • Updated tests/unit/services/TaskService.test.ts to cover the narrowed rule.
  • Ran npm run typecheck, npm run lint, npm run i18n:check, npm run build, npm run check:bundle-size, npm run docs:check, npm run test:unit, and npm run test:integration — all passing.

Refs #2691

@callumalpass
callumalpass merged commit ba2ab9e into main Nov 26, 2026
3 checks passed
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