Skip to content

fix(tasks): preserve task metadata on completion - #238

Open
fallintoplace wants to merge 1 commit into
ClickHouse:mainfrom
fallintoplace:fix/task-done-preserve-metadata
Open

fix(tasks): preserve task metadata on completion#238
fallintoplace wants to merge 1 commit into
ClickHouse:mainfrom
fallintoplace:fix/task-done-preserve-metadata

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Problem

Completing a task moves its Markdown file and calls upsert_task() to refresh the SQLite index. Both completion paths supplied only the new path, status, title, and content.

upsert_task() has replacement semantics, so the omitted values were written back as defaults. Completing a task therefore cleared its source, source URL, deadline, and tags. The missing tags also removed them from full-text search.

Fix

Carry the metadata from the existing database row into the completion upsert in both task_done_handler() and TaskManager.mark_done(). This keeps the change local to completion and leaves the intended replacement behavior of upsert_task() unchanged.

Verification

Added regression coverage for both completion paths that verifies:

  • source, source URL, deadline, and tags are unchanged
  • the task file moves to memory/tasks/done/
  • the completed task remains discoverable through tag-filtered search

129 passed across the task completion, task status, and database suites.

@fallintoplace
fallintoplace force-pushed the fix/task-done-preserve-metadata branch from 5acb99f to d351fce Compare July 30, 2026 19:45
@fallintoplace fallintoplace changed the title fix(tasks): preserve metadata when completing tasks fix(tasks): preserve task metadata on completion Jul 30, 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