Repository navigation
fix(import): refuse payloads Things saves differently from what they say - #418
Merged
Merged
Conversation
Refuse before sending: a key given twice in one object (duplicate-key), a title over 4000 characters or notes over 10000 (too-long), items on a to-do or checklist-items on a project (invalid-item), a creation-date or completion-date in the future (future-date), and a when or deadline Things would misread (invalid-date). Accept a lowercase z in a date, which Things takes. Report created titles as Things saves them, padding included.
Report a created title with line feeds as spaces, as Things saves it, name each refused attribute once, and say in the when/deadline refusal that weekdays and phrases pass through.
A when with an @ must have today, tomorrow, evening or a real YYYY-MM-DD before it and a real time of day after it. Things files tomorrow@25:00 with no reminder and ignores the time after someday or anytime. A deadline with an @ is refused too.
This was referenced Oct 9, 2026
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.
importsent some payloads that Things accepts but saves as something else. The CLI then either reported the item missing ("None of them appeared"), which leads an agent to re-run and create a duplicate, or reported success for an item with the wrong date. It also refused a date format Things accepts. This change refuses those payloads before anything is sent, and accepts the date format.Now refused before sending
titles. Things keeps the first value, while Go's decoder keeps the last, so the read-back looked for a title that was never saved. New reasonduplicate-key, with the key inblocked. The raw JSON is walked token by token to find these.addalready enforces. New reasontoo-long.itemson a to-do, orchecklist-itemson a project, whatever their value. Things ignores them and creates the item without them. Reasoninvalid-item. A string value was refused before asinvalid-type. It is still refused, now with a message saying Things would ignore it.creation-dateorcompletion-datein the future, more than a minute ahead. Things saves it as now. New reasonfuture-date. This includes an hour past 23 that rolls into the future, such as today's date atT25:00:00.whenordeadlineThings would misread. For example,whenof2026-13-01or18:00lands in Today, anddeadlineof2026-13-01becomes 1 January. Reasoninvalid-date. The check runs the same functionsadduses, so a misspelt keyword, or a keyword used as a deadline, is refused. Those functions let through any date or time they cannot read, and the Things JSON format only documents keywords, a date and a date with a time. So a value that starts with a digit must be a realYYYY-MM-DD, orYYYY-MM-DD@HH:MMforwhen. Weekdays and English phrases are still sent unchanged, asaddsends them.Other changes
zin a date is now accepted. Things accepts it; only a lowercasetis rejected.+012or a five-digit year. Things guesses at those or drops the date without saying so, soimportstill refuses them.importsections ofcommands.mdandagents.md, the bundled skill, and the reason list inerrors.gocover all of the above.Testing
Table-driven tests cover every refusal and every accepted form listed above.
make testandmake lintpass.