Four small problems from shipping a local-first task app
说明与用途
OpenTodo 0.9.0 解决了四个本地优先问题:标题编辑解析、计时器同步、只读问题导入和来源数据加密。
问题
Implementing local‑first features in OpenTodo revealed subtle issues: parsing edits, synchronising timers, importing issues without write‑back, and encrypting origin data.
结果
OpenTodo 0.9.0 resolved four subtle local‑first challenges, improving user experience and security while maintaining sync consistency.
工作流
- Implement title parser to compare base and draft, extracting only the edited span.
- Define deterministic timer repair: keep entry with latest started_at, end others.
- Add read‑only issue import with opt‑in and outbound policy.
- Encrypt origin object as one ciphertext string and store as opaque value.
- Use OpenSpec workflow to write specs, code, and review with AI agents.
证据
The fix is to read only the edit. When editing starts, the current title becomes the base. On commit, the parser finds the common prefix and the common suffix of the base and the draft, treats those spans as if they were quoted, and reads only the text in between.
Among a user's running entries, the one to keep is the one with the greatest started_at, with ties broken by the greatest id.
The design decision that shaped everything else was that nothing is ever written back.
The origin is encrypted as one whole value: the object is serialised, then encrypted into one ciphertext string.
- 记录日期: 2026-11-02T19:28:56.529Z