Go to file
Krzysztof kuhy Rudnicki 313368530a Restore notes at their own edit time, not "now"
Backup recovery and file import both wrote restored notes through `upsert`,
which stamps a fresh clock. Under crdt_sync's per-field last-writer-wins that
makes a *restore* outrank every other device: the restoring device claims it
edited every field just now, so it silently overwrites newer edits made
elsewhere on the next sync.

This is not hypothetical. The new desktop app seeded itself from BACKLOG.md and
rewrote 245 of 330 field clocks to today under a fresh node id, then synced --
taking authority over the phone for ~74% of all fields. Content happened to
survive (the copy came from the same data; only a trailing newline on 5 notes
differed via the Markdown round-trip), but nothing about the mechanism
guaranteed that.

The legacy sqlite migration already did the right thing for exactly this
reason, so the fix is to use that same helper everywhere a note is *restored*
rather than newly written. Renamed legacyRecordFor -> recordAtNoteTime, since
it is no longer migration-specific.

The freshness check in importNotes is unchanged: it decides whether the import
wins *locally*. The clock decides whether it wins on *other* devices, and an
import must not win there merely by being recent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 14:24:13 +02:00
.agents/skills Add Flutter/Dart agent skills and AI rules for Claude Code 2026-06-22 22:53:03 +02:00
android Replace the stock Flutter launcher icon, add a Linux desktop icon 2026-07-19 17:01:32 +02:00
assets/icon Replace the stock Flutter launcher icon, add a Linux desktop icon 2026-07-19 17:01:32 +02:00
bin Package the desktop app as the web build, and delete the Linux embedder 2026-07-20 14:08:00 +02:00
desktop Package the desktop app as the web build, and delete the Linux embedder 2026-07-20 14:08:00 +02:00
docs Document why the Linux desktop build must move off Flutter's embedder 2026-07-20 12:48:38 +02:00
lib Restore notes at their own edit time, not "now" 2026-07-20 14:24:13 +02:00
mcp Add read-only MCP server for the backlog 2026-07-10 21:20:39 +02:00
test Restore notes at their own edit time, not "now" 2026-07-20 14:24:13 +02:00
tool Switch to very_good_analysis, matching the rest of the Flutter ecosystem 2026-07-20 11:05:13 +02:00
web Make the app compile and run for web, behind platform seams 2026-07-20 13:14:03 +02:00
.gitignore Add list filters/sort, status, priority rework, export/import, structured template 2026-06-15 16:52:59 +02:00
.mcp.json Add read-only MCP server for the backlog 2026-07-10 21:20:39 +02:00
.metadata Make the app compile and run for web, behind platform seams 2026-07-20 13:14:03 +02:00
analysis_options.yaml Switch to very_good_analysis, matching the rest of the Flutter ecosystem 2026-07-20 11:05:13 +02:00
CLAUDE.md Package the desktop app as the web build, and delete the Linux embedder 2026-07-20 14:08:00 +02:00
install_arch.sh Package the desktop app as the web build, and delete the Linux embedder 2026-07-20 14:08:00 +02:00
LICENSE Add MIT license 2026-06-14 14:42:45 +02:00
MIGRATION.md Add MIGRATION.md documenting the sqlite_crdt -> crdt_sync move 2026-07-11 23:55:08 +02:00
pubspec.lock Make the app compile and run for web, behind platform seams 2026-07-20 13:14:03 +02:00
pubspec.yaml Make the app compile and run for web, behind platform seams 2026-07-20 13:14:03 +02:00
README.md Initial commit: offline-first CRDT notes app (capture + GitHub sync) 2026-06-14 14:20:19 +02:00
run.sh Package the desktop app as the web build, and delete the Linux embedder 2026-07-20 14:08:00 +02:00
skills-lock.json Add Flutter/Dart agent skills and AI rules for Claude Code 2026-06-22 22:53:03 +02:00

todo

A new Flutter project.

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.