utils/crdt_sync_dart/test
Krzysztof kuhy Rudnicki f902bbe0aa
Some checks failed
crdt-sync pre-commit / pre-commit (push) Has been cancelled
crdt-sync tests / test (3.10) (push) Has been cancelled
crdt-sync tests / test (3.11) (push) Has been cancelled
crdt-sync tests / test (3.12) (push) Has been cancelled
Let a mirror read survive the primary being down
MirrorSyncClient promised that reads consult both backends "so the
cutover order is irrelevant", but every read called self.primary
unguarded. A Firebase outage therefore produced no data at all and the
GitHub mirror was never consulted -- the union read silently degraded to
nothing, precisely when the fallback existed to help.

This is not hypothetical: screen-locker's workout sync hit it on
2026-08-10, where a DNS failure reading the primary took down the whole
locker rather than falling back.

Reads (list_directory, get_file_text, get_string_map) now degrade to the
mirror when the primary raises, and only fail when NEITHER backend can
answer -- returning an empty result would be indistinguishable from "no
data", which callers act on. Writes keep the old asymmetry on purpose: a
write the primary did not accept has not happened, so it must still fail
the tick.

A mirror that cannot bulk-read (GitHub) contributes nothing but is not a
failure, so it cannot by itself make a revision-map read raise. Both
language ports agree on that.

Same fix in the Dart port, which had all three read paths wrong too and
runs on the phone. Two older tests asserted the buggy read-fail-closed
behaviour and are renamed to describe what they actually exercise: the
both-sides-failed case.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JS5V44jkHZiH1wC7BH5h5n
2026-08-10 14:30:29 +02:00
..
device_test.dart Add DeviceIdentity and a legacy device id for the uuid migration 2026-08-09 16:54:33 +02:00
firebase_account_provisioning_test.dart Let a desktop wrapper provision the sync account, no UI required 2026-08-09 21:33:22 +02:00
firebase_auth_rest_test.dart crdt_sync: add a Firebase Realtime Database transport behind a RemoteStore seam 2026-08-03 18:14:25 +02:00
firebase_client_test.dart crdt_sync: add a Firebase Realtime Database transport behind a RemoteStore seam 2026-08-03 18:14:25 +02:00
firebase_config_test.dart crdt_sync 0.5.0: the shared config and the cutover seam 2026-08-04 22:59:48 +02:00
firebase_settings_test.dart crdt_sync_dart 0.6.0: split Firebase settings by what is safe to publish 2026-08-04 23:05:13 +02:00
github_client_test.dart crdt_sync: add a Firebase Realtime Database transport behind a RemoteStore seam 2026-08-03 18:14:25 +02:00
hlc_test.dart Initial implementation: unified CRDT merge scheme + GitHub sync transport 2026-07-05 20:48:07 +02:00
log_test.dart Initial implementation: unified CRDT merge scheme + GitHub sync transport 2026-07-05 20:48:07 +02:00
mirror_store_test.dart Let a mirror read survive the primary being down 2026-08-10 14:30:29 +02:00
record_test.dart Fix wire-format key mismatch with Python (deletedHlc -> deleted_hlc) 2026-07-05 20:55:22 +02:00
secure_credential_store_test.dart crdt_sync_dart 0.5.1: a shared secure credential store 2026-08-04 23:01:54 +02:00
store_test.dart Add LogStore local-persistence layer to crdt_sync (v0.2.0) 2026-07-11 22:19:34 +02:00
sync_revisions_test.dart crdt_sync 0.5.0: the shared config and the cutover seam 2026-08-04 22:59:48 +02:00
sync_test.dart Add DeviceIdentity and a legacy device id for the uuid migration 2026-08-09 16:54:33 +02:00