Skip to content

Derive incremental LoFi polling watermarks from sync timestamps #35

Description

@rwjblue

Context

Sidecar sends its incremental watermark as syncedSinceMillis, but currently derives that watermark from each QSON record's updatedAtMillis in src/main.rs.

Those fields represent different timestamp domains. Mixing them can cause changes to be missed or repeatedly fetched.

Scope

  • Confirm the observed LoFi synchronization timestamp semantics using synthetic fixtures and the documented client contract.
  • Derive incremental QSO polling watermarks from syncedAtMillis or authoritative server sync metadata.
  • Define inclusive-boundary and missing-timestamp behavior.
  • Keep the watermark transactional with normalization and last-good-state persistence.

Acceptance criteria

  • A syncedSinceMillis query is never populated from updatedAtMillis.
  • Inclusive-boundary duplicates are handled idempotently by QSON UUID.
  • Contacts, updates, and tombstones advance through the same synchronization pipeline.
  • The watermark advances only after normalization and last-good persistence succeed.
  • Changing operations resets the watermark.
  • Missing or incompatible sync timestamps fall back safely without silently skipping records.
  • Synthetic tests cover new contacts, updates, tombstones, equal timestamps, selection changes, and failed persistence.
  • No cursor or private record values appear in logs or diagnostics.

Related work

Resolve this before or during migration to the shared lofi-client so the existing timestamp mismatch is not carried into the new adapter.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions