Skip to content

feat: cut the write read-back wait to 5s and make it configurable - #281

Merged
ryanlewis merged 3 commits into
mainfrom
feat/verify-timeout
Sep 30, 2026
Merged

ryanlewis merged 3 commits into
mainfrom
feat/verify-timeout

Conversation

@ryanlewis

Copy link
Copy Markdown
Owner

Cuts the write read-back wait from 10s to 5s and makes it configurable, because 10s is too long to wait on every write that is dropped or changes nothing.

What changes

  • New global flag --verify-timeout DURATION (Go duration such as 5s or 2500ms), default 5s.
  • New config key verify_timeout = "5s", included in the config init template and config show.
  • Precedence is flag > config file > default, the same as every other key.
  • Zero, negative and unparsable values are refused. The error names where the value came from and points to --no-verify for skipping the wait:
    • --verify-timeout: must be a positive duration such as "5s" or "2500ms", got "0s" — to skip the read-back entirely, use --no-verify
    • config file <path>: key "verify_timeout" must be a positive duration such as "5s" or "2500ms", got "soon" — to skip the read-back entirely, set no_verify = true
  • Every read-back uses the configured value: complete, cancel, edit, project edit, status items in import, and tag add. Their errors print it (for example "not modified within 1.5s").
  • The poll no longer sleeps past its deadline, so a read-back stops at the budget it was given instead of up to 100ms later.
  • Docs: configuration.md (key table, template, error example), commands.md, the README flag and key tables, and SKILL.md.

Testing

  • make test and make lint pass.
  • New tests cover precedence, bad values from the flag and the file, config show, and a read-back per write path showing the configured value reaches the wait.
  • Ran the built binary with a temp HOME against a copy of a Things backup, with fake open/osascript on PATH so nothing reached Things. An edit that could not land failed after 5.1s by default, 3.1s with verify_timeout = "3s", 1.5s with --verify-timeout 1500ms, and 1.0s with the flag at 1s overriding a 3s config.

Add --verify-timeout, $THINGS_CLI_VERIFY_TIMEOUT and the verify_timeout config key, with precedence flag > env > config > default. The env var goes through the config resolver rather than kong's env tag, which kong applies before resolvers and so would lose to the file. Zero, negative and unparsable values are refused with an error naming the source and pointing at --no-verify. Every read-back (complete, cancel, edit, project edit, import status items, tag add) now uses the configured value.
No other setting has its own environment variable, so verify_timeout keeps the same precedence as every other key: flag > config file > default. The test harness now gives a run that leaves --verify-timeout at its default the package fallback, which fastVerify shrinks.
The poll slept a full interval between reads, so a read-back could run up to 100ms past --verify-timeout while its error reported the configured value. Also list --verify-timeout in the README flags table and drop its stale 10-second figure.
@ryanlewis
ryanlewis merged commit 3135eae into main Sep 30, 2026
10 checks passed
@ryanlewis
ryanlewis deleted the feat/verify-timeout branch September 30, 2026 01:44
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