Skip to content

fix(edit): leave a row Things has not moved into today where it is for --when today - #399

Merged
ryanlewis merged 3 commits into
mainfrom
fix/unmoved-rows
Oct 7, 2026
Merged

ryanlewis merged 3 commits into
mainfrom
fix/unmoved-rows

Conversation

@ryanlewis

@ryanlewis ryanlewis commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #398. Just after midnight, or whenever Things hasn't run since a row's date, a scheduled row Things hasn't moved into today yet is still stored with start = 2 (Someday). The task queries report it as Anytime.

Measured (#398): on a to-do dated today, in the day part, with no reminder, --when today and today's date change nothing. That case stays a certain no-op and prints at once. --when evening moved the same row, so it is a change.

Unmeasured: a row with a reminder, a row dated before today, a project, a row in the evening part, and a past date. These are not treated as no-ops, because if Things does move the row, the CLI would print stale data. Instead the edit is sent and read back, and the read-back accepts either outcome:

  • the row lands where --when puts it, or
  • for a --when-only edit, the row stays where it was and nothing is recorded by the end of the budget.

So a correct write never reports failure, and the CLI never prints a row Things may have moved. The cost is the read-back wait (5s by default) when Things leaves the row. An edit with other fields still needs those recorded. The rules are in unmovedMeasured and unmovedKeeps.

Telling an unmoved row from a moved one needs the stored start, so db.StoredStart reads it. It's only read for a --when edit, and not under --duplicate or --no-verify.

Tests:

  • No-op cases for the measured row. Evening, a time, and a moved older row still wait.
  • TestEditUnmovedRowAcceptsEitherOutcome: each unmeasured case, with Things moving the row and with Things leaving it, confirmed both times, and the printed row matches.
  • An unmoved row with --title and nothing recorded still fails.
  • StoredStart.

commands.md is updated.

…r --when today

The midnight probe measured one case: a to-do dated today, in the day
part, with no reminder, still stored as Someday, keeps its row through
--when today and today's date. The cases it did not cover now take the
side that never reports a correct write as failed: a reminder is kept,
a row dated before today keeps its date for today, today's date or a
past date, a project behaves as a to-do, and a row in the evening part
stays there. The no-op check and the read-back both follow it; the read
needs the stored start, which the task queries report as Anytime for
such a row, so db.StoredStart reads it.
unmoved takes the row's listed start as well as its stored one, so only
the rows shownStart rewrote count, and the stored start is not read for
--duplicate or --no-verify. The docs say an unmoved row is any Things has
not moved yet, not only just after midnight, and cover evening.
…ping them

Only the case the midnight probe measured stays a certain no-op: a to-do
Things has not moved into today, dated today, in the day part, with no
reminder, sent today or today's date. The unmeasured ones (a reminder, a
date before today, a project, the evening part, a past date) are sent and
read back, and the read-back accepts either outcome: the row where --when
puts it, or, for a --when-only edit, the row where it was with nothing
recorded once the budget runs out. So the edit never prints a row Things
may have moved, and never fails one it left. An edit with other fields
still needs those recorded.
@ryanlewis
ryanlewis merged commit 5cd30b9 into main Oct 7, 2026
10 checks passed
@ryanlewis
ryanlewis deleted the fix/unmoved-rows branch October 7, 2026 23:32
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