Tearleads

document_sync_progress Client SQLite table

Where a document's last completed pull reached, what it was judged with, and what the pull in progress started from. One row per document scope.

Declared in packages/client-sdk/src/data/sqlite/schema/documentSyncVerdictSchema.ts

Columns

  • app_kindtext
    • not null

    Document scope matching documents.

  • local_idtext
    • not null

    Document scope matching documents.

  • document_idtext
    • not null

    The server document the pull read; a row for another id is never sent.

  • through_update_idtext
    • nullable

    The completed pull's upper bound, or null before one completes. Every update committed at or before it was either served and processed (imported or voided) or had a declared span the request's version already covered.

  • through_update_countinteger
    • nullable

    How many updates the document held through throughUpdateId, as the server counted them, or null when unknown. A container listing's metadata update count at or below it owes no read.

  • through_versiontext
    • nullable

    The persisted content frontier (snapshotEndVersion) when the cursor was written. The cursor is sent only while the current frontier covers it, so a restore to older state pulls by version alone.

  • judgetext
    • nullable

    The void rules and Loro decoder the verdicts were reached with (documentVerdictJudge). A device whose judge changed sends no cursor until a pull without one has judged every uncovered update again.

  • pull_judgetext
    • nullable

    The judge and the cursor of the first page of the pull in progress (pullJudge is null when none is). A pull advances the cursor only if every later page ran under the same two.

  • pull_sent_cursortext
    • nullable

    The judge and the cursor of the first page of the pull in progress (pullJudge is null when none is). A pull advances the cursor only if every later page ran under the same two.

Keys and constraints

  • Primary key(app_kind, local_id)

DDL

The statements the client runs to create this table and its indexes.

CREATE TABLE IF NOT EXISTS "document_sync_progress" (
  "app_kind" TEXT NOT NULL,
  "local_id" TEXT NOT NULL,
  "document_id" TEXT NOT NULL,
  "through_update_id" TEXT,
  "through_update_count" INTEGER,
  "through_version" TEXT,
  "judge" TEXT,
  "pull_judge" TEXT,
  "pull_sent_cursor" TEXT,
  PRIMARY KEY ("app_kind", "local_id")
);