Skip to content

docs: explain pending import persistence and import status - #54

Merged
zxch3n merged 2 commits into
mainfrom
docs/export-pending-updates
Oct 22, 2026
Merged

zxch3n merged 2 commits into
mainfrom
docs/export-pending-updates

Conversation

@zxch3n

@zxch3n zxch3n commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Snapshots omit imported operations that are still waiting for causal dependencies. The previous persistence advice could therefore discard received update bytes before a checkpoint could safely restore them after a restart.

Document exportPendingUpdates(), available since loro-crdt@1.17.0 and loro.js@0.4.0. Cover its read-only behavior, Uint8Array | undefined result, ordinary import() recovery, and the published Rust 1.17.0 method. Link the FFI binding source separately; availability in a released language package must be checked independently.

Explain consistent snapshot-plus-pending checkpoints, clearing a stale pending record on undefined, keeping the previous checkpoint on export failure, and preserving recovery material before advancing durable cursors or deleting original updates. Correct import-status examples to use Map<PeerID, CounterSpan> and required pending: Map<PeerID, CounterSpan> | null. An individual import result is not a query of the whole pending queue, and an empty queue does not establish synchronization. Update the six API/concept/tutorial pages and all links to the released persistence heading.

Validation at d5adccad15c7daa20b5e87f4def908fda3cf67ac:

  • Downloaded both actual npm releases and verified their tarballs against official registry SHA-512 integrity and SHA-1 metadata. No local core build or dependency override was used.
  • Extracted the exact complete persistence example and out-of-order import example from the final MDX. Executed both against each published implementation (only the pure TypeScript import changes to loro.js): four successful executions. The persistence example has ten throwing assertions covering pending B, snapshot exclusion, repeated export, restart, dependency A, and clearing the old pending record.
  • Strict TypeScript checks passed for both examples against both published packages, without skipLibCheck.
  • pnpm build passed: 81 generated Next.js pages, 72/72 rendered SEO checks, and the OpenNext bundle. pnpm test:seo passed 5/5.
  • pnpm test passed 161/161 existing code-block executions. That runner pins loro-crdt@1.13.3 and skips no_run; these results are separate from the released-package checks above.
  • Checked the rendered API method ID, persistence heading ID, version text, Rust method link and inbound links across all six pages. git diff --check passed.

Original rendered persistence screenshot (captured before the release labels and heading were updated):

Pending-import persistence documentation

Related: Loro core #1220, Rust release #1221, FFI #17, Lody investigation #1815. This documentation PR has not been deployed.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loro-docs d5adcca Commit Preview URL

Branch Preview URL
Oct 22 2026, 01:03 PM

Document WASM 1.17.0, pure TypeScript 0.4.0 and Rust 1.17.0 availability; update persistence anchors and keep language binding releases separate.

Model: gpt-6.1-sol
@zxch3n
zxch3n marked this pull request as ready for review October 22, 2026 12:58
@zxch3n
zxch3n merged commit fed8589 into main Oct 22, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant