utils/crdt-sync/crdt_sync
Krzysztof kuhy Rudnicki 4468df0e13 Pool HTTP connections, and let callers set the Firebase timeout
Every request went through the module-level requests.get/put/post/delete
helpers, so each one paid a fresh DNS+TCP+TLS handshake. Measured today
against the real backends that is 95ms/req to api.github.com and 52ms to
Realtime Database -- on a 27-request diet-guard tick, most of the wall clock.

Each transport module now binds a pooling requests.Session to the name
`requests`. A Session is a drop-in for those helpers, so all 9 call sites and
all 16 tests that patch `<module>.requests.<verb>` are untouched; the real
module stays available as `_requests` for the RequestException/Response
references. Sessions are per-module rather than shared because the tests use
sequence-consuming side_effect lists, where one module could otherwise eat
another's queued response.

Transient failures now retry, restricted to GET: a PUT here carries a
Contents-API sha, and replaying one whose response was merely lost would
write against a stale precondition on a remote the phone also reads.

Also thread timeout_seconds through firebase_client_for, which accepted none,
so a caller's tighter budget silently reached the GitHub backend only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCucBhUkHBBHHbsY7bSdGV
2026-08-21 13:55:01 +02:00
..
tests Sign in with Google, and stop trusting a revoked session 2026-08-11 23:58:02 +02:00
__init__.py Add DeviceIdentity and a legacy device id for the uuid migration 2026-08-09 16:54:33 +02:00
_config.py Pool HTTP connections, and let callers set the Firebase timeout 2026-08-21 13:55:01 +02:00
_device.py Add DeviceIdentity and a legacy device id for the uuid migration 2026-08-09 16:54:33 +02:00
_firebase_auth.py Pool HTTP connections, and let callers set the Firebase timeout 2026-08-21 13:55:01 +02:00
_firebase.py Pool HTTP connections, and let callers set the Firebase timeout 2026-08-21 13:55:01 +02:00
_github.py Pool HTTP connections, and let callers set the Firebase timeout 2026-08-21 13:55:01 +02:00
_hlc.py Initial implementation: unified CRDT merge scheme + GitHub sync transport 2026-07-05 20:40:09 +02:00
_http.py Pool HTTP connections, and let callers set the Firebase timeout 2026-08-21 13:55:01 +02:00
_log.py Initial implementation: unified CRDT merge scheme + GitHub sync transport 2026-07-05 20:40:09 +02:00
_mirror.py Let a mirror read survive the primary being down 2026-08-10 14:30:29 +02:00
_record.py Initial implementation: unified CRDT merge scheme + GitHub sync transport 2026-07-05 20:40:09 +02:00
_remote.py crdt_sync: add a Firebase Realtime Database transport behind a RemoteStore seam 2026-08-03 18:14:25 +02:00
_store.py Add LogStore local-persistence layer to crdt_sync (v0.2.0) 2026-07-11 22:19:34 +02:00
_sync.py Add DeviceIdentity and a legacy device id for the uuid migration 2026-08-09 16:54:33 +02:00