Skip to content

Fix occurrence notes which don't have today's date - #2175

Merged
callumalpass merged 10 commits into
callumalpass:mainfrom
chmac:2173-occurrence-notes-anchor-completion
Aug 1, 2026
Merged

Fix occurrence notes which don't have today's date#2175
callumalpass merged 10 commits into
callumalpass:mainfrom
chmac:2173-occurrence-notes-anchor-completion

Conversation

@chmac

@chmac chmac commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

This PR is dependent on this PR in the model repo: callumalpass/tasknotes-model#8

It makes a minor change to leverage that PR.

Same disclaimer applies, I've read the code, and it works for me locally, I'm running it on my vault, but I don't know your codebase well enough to make any statements about its quality.

theoretically fixes #2173

chmac and others added 10 commits June 22, 2026 15:08
- When scheduled dates are in the future
- When the scheduled date has changed from the recurrence date
- Keeps due date relative to the recurrence (DTSTART) date
- When scheduled dates are in the future but before the next recurrence
@tasknotes/model now accepts an explicit completionDate so that completing a
materialized occurrence under recurrence_anchor: completion advances the
parent using when it was actually completed, not the occurrence's identity
date. Requires an @tasknotes/model release that includes this field to take
effect.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…occurrence_date.

getCompletionDateForTask preferred occurrence_date over the real completion
date whenever it was present, which is exclusively the case for materialized
occurrence notes - so completing one always recorded completedDate as the
occurrence's identity date instead of when it was actually marked done.
Removed the helper and call getCurrentDateString() directly in
updateProperty, matching how completedDate works for every other task.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
# Conflicts:
#	src/core/recurrence.ts
#	src/services/TaskService.ts
#	src/services/task-service/taskRecurringPlanning.ts
#	tests/unit/issues/issue-2064-dynamic-scheduled-dates-completion.test.ts
@callumalpass

Copy link
Copy Markdown
Owner

Thanks @chmac — excellent catch, and the linked regression made the failure easy to pin down. I’ve updated the model change so occurrence history remains keyed by occurrence_date while completion-anchored progression uses the real completion date, published the corrected model release, rebased this onto current main, and added end-to-end coverage plus the unreleased entry.

@callumalpass
callumalpass merged commit 7e9ee84 into callumalpass:main Aug 1, 2026
2 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.

[Bug]: Recurrence anchor completion doesn't work with occurrence notes

2 participants