Skip to content

fix(import): refuse dates Things rejects, name shares-dated-title candidates, decode once - #391

Merged
ryanlewis merged 4 commits into
mainfrom
fix/import-polish
Oct 7, 2026
Merged

ryanlewis merged 4 commits into
mainfrom
fix/import-polish

Conversation

@ryanlewis

Copy link
Copy Markdown
Owner

Follow-ups to the import read-back work (#355, #374).

Dates Things rejects

I checked in Things 3 by importing test items. Things rejects the whole payload, with a "There is a problem with the provided JSON." sheet, when a creation-date or completion-date on a to-do or project (created or updated) is a date on its own, a time with no offset, a time with no seconds, has a lowercase t/z, a comma before the fraction, surrounding spaces, or is a number. It takes one-digit fields (2026-10-5T9:30:00Z) and offsets written as Z, +02:00, +0200, +02 or +2. A null creation-date is no date: Things saves the item as created now.

Before this change, a date-only or timezone-less creation-date counted as recent. Things never created anything from that payload, so every undated item was then reported not-found, with a hint to check that Things was running. import now refuses such a payload before sending anything, including before --create-tags makes any tag, and names each item. Under --json this is import refused, and blocked names the attribute. The repeating-item refusal also runs before the tag check now, so a refused import never creates tags.

shares-dated-title

An item reported shares-dated-title now lists its new items in candidates, the field ambiguous and not-found already use, so the JSON shape only gains data. The check is also destination-aware: an undated item is only held back when one of its new items is also filed where the recently dated item with the same title goes.

Decode once

The payload was decoded four times: once to validate it, then again for tags, update items and created items. It is now decoded once and the decoded tree is passed to each check.

…ed-title candidates

Things rejects the whole payload over a creation-date that is not a date and time with seconds and a UTC offset, so import now refuses it before sending instead of treating it as recent. A null creation-date is read back like an undated item, as Things saves it as created now. Items reported shares-dated-title list the new items they could be in candidates. The payload is decoded once and shared by every check.
… refuse before --create-tags

Things takes one-digit date and time fields and rejects a comma before the fraction, and rejects a bad creation-date or completion-date on an update item too, so the date check now follows the shape Things takes and covers every to-do and project. Both refusals, and the repeating one, now run before the tag check, so --create-tags writes nothing for a refused payload. An undated item is only reported shares-dated-title when one of its new items is also filed where the dated item goes.
…er item

The date check now reads the item type trimmed, as the rest of the import does, and its refusals join the repeating ones in importRefusalError: one entry per item naming every blocked attribute and a reason, with an update item's id and database title. An undated item sharing a recent dated item's title fails as shares-dated-title again when the database cannot be read. importTags uses walkImportNode.
@ryanlewis
ryanlewis merged commit 00eba2d into main Oct 7, 2026
10 checks passed
@ryanlewis
ryanlewis deleted the fix/import-polish branch October 7, 2026 22:29
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