utils/crdt-sync/tool
Krzysztof kuhy Rudnicki 5f64a8959b
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
Sign in with Google, and stop trusting a revoked session
Two changes to the shared sync credential path, both driven by devices
that reported "Connected" while every sync failed.

Google sign-in (signInWithGoogle, both languages) replaces typing the
sync account's password on a fresh install. The account is linked once
from the PC with tool/link_google.py, which asserts the pinned uid --
without that assertion an unlinked identity is *signed up* rather than
refused, and the new uid is then denied every read and write by the
security rules.

The second change is the one with teeth. hasSession() is a presence
check, so a refresh token the server had revoked still read as a live
session: the desktop todo build showed "Connected" and then failed every
sync with `HTTP 400 (TOKEN_EXPIRED)`. A refresh that fails for a terminal
reason now clears the stored session, so hasSession() answers honestly.

Deliberately narrow: only TOKEN_EXPIRED, USER_DISABLED, USER_NOT_FOUND,
INVALID_REFRESH_TOKEN, INVALID_GRANT_TYPE and MISSING_REFRESH_TOKEN
clear it. A network error or a 5xx must not -- a device that signs
itself out whenever the wifi drops needs a manual sign-in on every
device to recover, which is worse than the stale banner this fixes.
Verified against the live endpoint, not just mocks: has_session flips
True -> False on a real rejection.

crdt_sync_dart 0.9.0 -> 0.10.0; the five apps pin the matching tag.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192EkoAyFBEWTvAN5vVgmSy
2026-08-11 23:58:02 +02:00
..
__init__.py crdt_sync: add the one-shot GitHub -> Firebase data migration 2026-08-03 18:31:18 +02:00
google_id_token.py Sign in with Google, and stop trusting a revoked session 2026-08-11 23:58:02 +02:00
interop_seed.py crdt_sync 0.5.0: the shared config and the cutover seam 2026-08-04 22:59:48 +02:00
link_google.py Sign in with Google, and stop trusting a revoked session 2026-08-11 23:58:02 +02:00
migrate_github_to_firebase.py crdt_sync: add the one-shot GitHub -> Firebase data migration 2026-08-03 18:31:18 +02:00
preflight_firebase.py crdt_sync 0.5.0: the shared config and the cutover seam 2026-08-04 22:59:48 +02:00
seed_session.py Sign in with Google, and stop trusting a revoked session 2026-08-11 23:58:02 +02:00