Repository navigation
fix(edit): leave a row Things has not moved into today where it is for --when today - #399
Merged
Merged
Conversation
…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.
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.
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 todayand today's date change nothing. That case stays a certain no-op and prints at once.--when eveningmoved 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:
--whenputs it, or--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
unmovedMeasuredandunmovedKeeps.Telling an unmoved row from a moved one needs the stored start, so
db.StoredStartreads it. It's only read for a--whenedit, and not under--duplicateor--no-verify.Tests:
TestEditUnmovedRowAcceptsEitherOutcome: each unmeasured case, with Things moving the row and with Things leaving it, confirmed both times, and the printed row matches.--titleand nothing recorded still fails.StoredStart.commands.mdis updated.