Go to file
Krzysztof kuhy Rudnicki b9d9ac6521 Migrate notes storage from sqlite_crdt to the shared crdt_sync LogStore
NoteRepository is rewritten on crdt_sync's LogStore: each Note is stored *as*
a Record (per-field LWW + sticky tombstone), so the on-disk log IS the sync
wire format. Its public API is unchanged (upsert/delete/listNotes/watchNotes/
watchCount/importNotes/changes/nodeId), so the UI and most tests are
untouched; only the internals, the two sync methods (getChangeset/merge ->
exportLog/importLog over a Log), and the changeset-specific tests change.
Filtering/sorting now run in Dart over the in-memory log; watchNotes/watchCount
seed synchronously in onListen to avoid a subscription race.

SyncService moves from per-device sqlite changesets to per-device crdt_sync
Logs under a new todo-sync/notes/ path (clean format cutover; old clients
can't misread a new file). todo's own GitHubClient transport is kept.

One-time migration in NoteRepository.open: reads the legacy sqlite DB (kept
untouched as a safety net; the dep stays only for this), seeds every note --
tombstones included -- into the log with each field's HLC derived from its
updated_at (so a pre-cutover edit still wins by real edit time across two
independently-migrating devices), reuses the legacy node id, and sets a
persisted "migrated" flag so it never re-runs.

Verified: flutter analyze + dart format clean; 178 tests at 100% coverage
(incl. migration, tombstone, restore-race, and corrupt-peer cases). Device
verified on dev.kuhy.todo: real backlog of 27 live notes (+5 tombstones)
migrated intact -- confirmed against a pulled sqlite backup, the pulled
LogStore JSON, and the app's own "27 saved" -- notes render with status/
priority/dates, no crash, migration one-time.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019KwUCPESvE5CjCtmUFz8xQ
2026-07-11 23:28:54 +02:00
.agents/skills Add Flutter/Dart agent skills and AI rules for Claude Code 2026-06-22 22:53:03 +02:00
android Enable Android Auto Backup of the notes DB and sync settings 2026-06-15 22:04:59 +02:00
docs Add change explanation: cut per-keystroke O(N) work 2026-07-11 22:13:58 +02:00
lib Migrate notes storage from sqlite_crdt to the shared crdt_sync LogStore 2026-07-11 23:28:54 +02:00
linux Store the GitHub sync token in the OS keystore, migrating off plaintext 2026-06-15 22:57:05 +02:00
mcp Add read-only MCP server for the backlog 2026-07-10 21:20:39 +02:00
test Migrate notes storage from sqlite_crdt to the shared crdt_sync LogStore 2026-07-11 23:28:54 +02:00
tool Migrate notes storage from sqlite_crdt to the shared crdt_sync LogStore 2026-07-11 23:28:54 +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 Initial commit: offline-first CRDT notes app (capture + GitHub sync) 2026-06-14 14:20:19 +02:00
analysis_options.yaml Initial commit: offline-first CRDT notes app (capture + GitHub sync) 2026-06-14 14:20:19 +02:00
CLAUDE.md Point notes sync at the consolidated syncs monorepo 2026-07-10 14:04:05 +02:00
install_arch.sh Rename Arch package to todo-flutter to avoid AUR name collision 2026-07-10 17:35:38 +02:00
LICENSE Add MIT license 2026-06-14 14:42:45 +02:00
pubspec.lock Migrate notes storage from sqlite_crdt to the shared crdt_sync LogStore 2026-07-11 23:28:54 +02:00
pubspec.yaml Migrate notes storage from sqlite_crdt to the shared crdt_sync LogStore 2026-07-11 23:28:54 +02:00
README.md Initial commit: offline-first CRDT notes app (capture + GitHub sync) 2026-06-14 14:20:19 +02:00
run.sh Add run.sh to install Flutter desktop deps and launch the app 2026-06-19 17:05:45 +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.