Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/services/TaskService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ export class TaskService {
}

private getCompletionDateForTask(task: TaskInfo): string {
return task.occurrence_date || getCurrentDateString();
// Record the real completion date, matching non-recurring task behavior.
// Which occurrence was fulfilled is tracked separately on the parent's
// complete_instances (see buildMaterializedOccurrenceCompletePlan). #2125
return getCurrentDateString();
}

/**
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/services/task-occurrence-materialization.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,12 @@ describe("TaskService materialized occurrences", () => {

await taskService.updateProperty(occurrence, "status", "done");

// completedDate records when the user actually completed the occurrence
// (the mocked "today", 2025-01-01), while the parent's complete_instances
// keeps tracking WHICH occurrence was fulfilled (the occurrence date).
expect(frontmatterByPath.get(occurrence.path)).toMatchObject({
status: "done",
completedDate: "2026-06-01",
completedDate: "2025-01-01",
});
expect(frontmatterByPath.get(parent.path)).toMatchObject({
complete_instances: ["2026-06-01"],
Expand Down