todo-app/lib/sync/off_thread.dart
Krzysztof kuhy Rudnicki ea216d4a59
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
file-length / file length <= 250 lines (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Sync pulls peers at once, off the UI thread
The board reported a 3.9 s sync.run spinner on the Pixel (todo:0c575b891b).
Eight ~2 MB peer logs were fetched, parsed on the UI isolate and merged one
by one, each merge rewriting the whole local store; a device without a
GitHub token still mirrored to GitHub (404s); settings and analytics waited
for the note sync.

Now changed peers download together, logs over 64 KB parse on an isolate
(inline on web), peers merge into one local write, the revision map and
listing share a round trip, the mirror is skipped without a token, and
settings/analytics run alongside the notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 11:25:22 +01:00

8 lines
329 B
Dart

/// Runs CPU-heavy, pure work away from the UI thread where the platform can.
///
/// Conditional export because `dart:isolate` does not run in a browser: the
/// web desktop build runs the work inline, everything else on a fresh isolate.
library;
export 'off_thread_io.dart' if (dart.library.js_interop) 'off_thread_web.dart';