Repository navigation
fix(repeating): treat to-dos inside a repeating project template as repeating - #340
Merged
Merged
Conversation
…epeating A to-do inside a repeating project template carries no recurrence rule of its own, so Task.Repeating was false and edit --when/--deadline, complete, cancel and import updates on it were sent to Things, which drops them silently. The flag now also reads the resolved parent project's rule, so those writes are refused up front like they are on the template. To-dos inside a project Things generated from the template stay ordinary. Refs #174
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.
Closes #174
The second half of #174, the note on an empty
--projectlisting for a repeating project template, already shipped in #272. This PR does the first half: to-dos inside a repeating project template now count as repeating, so the writes Things drops silently on them are refused before anything is sent.Row layout
I could not observe a real one. None of the ten daily backups on this machine (2026-09-24 to 2026-10-03) holds a row with
rt1_recurrenceRuleorrt1_repeatingTemplate, and an earlier check of the 2026-09-01 to 2026-09-10 backups found repeating to-dos only, no repeating project (see the issue comments). So the change rests on the layout the code already assumes since #171: a to-do inside a template project links to it throughproject, or throughheadingand the heading'sproject, and carries no rule of its own, so only the project row hasrt1_recurrenceRule. The project Things generates from the template points back at it throughrt1_repeatingTemplateand has no rule.The check is conservative either way. A to-do counts as repeating if it has a rule itself or if its resolved parent project has one. If template children turn out to carry their own rule, nothing changes. To-dos inside a generated instance project are not flagged, because their parent has a template pointer, not a rule, and instances can be edited.
What changed
t.rt1_recurrenceRule OR p.rt1_recurrenceRule, wherepis the parent project already resolved throughCOALESCE(t.project, h.project). The column is still probed, as before. On a schema without it, both references becomeNULLand nothing repeats.edit --when/--deadline/--complete/--cancel/--duplicate,complete,cancelandimportupdates are refused with the existing "is a repeating task" message. Before, they went out and Things dropped them.showand--jsonmark it"repeating": true(it is only listed intrashandlogbook, andshowreaches it by uuid). The agent brief leaves outcomplete/cancel, as it does for other repeating items.things edit "Clear desk"goes to the ordinary to-do instead of showing the ambiguity list. This is the same rulepreferInstancesalready applies to repeating to-do templates.commands.mdandagents.mdsay that to-dos inside a template project count as repeating.Tests
TestTemplateProjectChildrenReportRepeating(internal/db): a child directly in a template project and one under a heading in it are flagged. A child of a generated instance project (rt1_repeatingTemplateset, no rule) and one in an ordinary project are not.TestRepeatingWritesAreRefusedUpFront(cmd/things): new cases forcomplete,edit --whenandedit --deadlineon a template child. They check the command is refused and no write is issued.make testandmake lintpass.open/osascriptstubbed onPATH. The old binary sent thewhenandcompletedwrites, which the stubs caught. The fixed binary refuses both before sending anything.show --jsongivesrepeating: truefor the template child and leaves it off for the instance child.Not verified against the live app; no repeating project exists.