Skip to content

fix: record real completion date on materialized occurrences - #2129

Merged
callumalpass merged 3 commits into
callumalpass:mainfrom
raphaelfaouakhiri:patch/real-completed-date
Aug 1, 2026
Merged

fix: record real completion date on materialized occurrences#2129
callumalpass merged 3 commits into
callumalpass:mainfrom
raphaelfaouakhiri:patch/real-completed-date

Conversation

@raphaelfaouakhiri

Copy link
Copy Markdown
Contributor

Fixes #2125

Problem

Completing a materialized occurrence writes the occurrence date (occurrence_date) into the occurrence note's completedDate — the same value as scheduled/due — losing the date the user actually completed it. Non-recurring tasks record the real current date.

Fix

TaskService.getCompletionDateForTask() returned task.occurrence_date || getCurrentDateString(). It now always returns getCurrentDateString(), matching non-recurring behavior.

Which occurrence was fulfilled is still fully tracked: buildMaterializedOccurrenceCompletePlan (in @tasknotes/model) appends the occurrence date to the parent's complete_instances independently, and that path is untouched.

Testing

  • Updated the unit expectation in task-occurrence-materialization.test.ts: the occurrence's completedDate is now the (mocked) current date, while the parent's complete_instances still receives the occurrence date. Suite passes.
  • Manually verified in a real vault (4.11.1 + this patch): completed occurrences of 2026-07-10 and 2026-07-11 on 2026-07-17 → each occurrence note got completedDate: 2026-07-17; parent got complete_instances: [2026-07-10, 2026-07-11]; scheduled advanced and the next occurrence materialized normally.

🤖 Generated with Claude Code

raphaelfaouakhiri and others added 3 commits July 17, 2026 06:09
Completing a materialized occurrence wrote the occurrence date
(occurrence_date) into completedDate, losing the actual completion
date. The parent's complete_instances already tracks which occurrence
was fulfilled, so completedDate can record when the user actually
completed it — matching non-recurring task behavior.

Fixes callumalpass#2125 (callumalpass/tasknotes)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@callumalpass
callumalpass merged commit e8b44c4 into callumalpass:main Aug 1, 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.

[FR]: Record the real completion date/time on materialized occurrences

2 participants