fix(core): treat empty notes content as no notes in task detail - #1161
Merged
Kohei-Wada merged 1 commit intoJul 25, 2026
Merged
Conversation
GetTaskDetailUseCase computed has_notes from 'notes_content is not None', but delete_notes implements deletion as write_notes(task_id, ""), leaving an empty row behind. NotesRepository.has_notes and get_task_ids_with_notes both require content != "", so after deleting a note the task list showed no indicator while show/detail reported has_notes=True with empty content. Use bool(notes_content) so the use case agrees with the repository. Closes Kohei-Wada#1157
Owner
|
Thanks for the fix! Verified that the change aligns the use case with the repository's content-based notes semantics, and the regression test properly covers the delete-then-detail path. Much appreciated! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
GetTaskDetailUseCasecomputedhas_notesfromnotes_content is not None, butNotesController.delete_notesimplements deletion aswrite_notes(task_id, ""), leaving an empty row behind.SqliteNotesRepository.has_notesandget_task_ids_with_notesboth requirecontent != "", so after deleting a note the two sources of truth disagreed: the task list showed no note indicator whileshow/detail reportedhas_notes=Truewith empty content. Fixed by usingbool(notes_content).Related Issue
Closes #1157
Type of Change
Changes Made
get_task_detail.py:has_notes = bool(notes_content)so an empty (deleted) note counts as no notes, matchingNotesRepository.has_notes().test_execute_after_notes_deletedregression test.Testing
Test Environment
Tests Performed
make test)The new test fails without the source change (
has_notes=Truewithnotes_content='') and passes with it, verified by stashing the source file. Fulltaskdog-coresuite: 1166 passed.Code Quality Checklist
make lint)make typecheck)make format)Ruff check and format are clean on both changed files.
Documentation
N/A — no user-facing API or architecture change.
Package Affected
Breaking Changes
Checklist
Additional Notes
The issue offered two directions; this takes the smaller one (
bool(notes_content)in the use case) rather than changingdelete_notesto drop the row, since the repository layer already treats empty content as "no notes".