Skip to content

feat: expose pending update export through FFI - #17

Merged
zxch3n merged 3 commits into
mainfrom
ffi-export-pending-updates
Oct 22, 2026
Merged

zxch3n merged 3 commits into
mainfrom
ffi-export-pending-updates

Conversation

@zxch3n

@zxch3n zxch3n commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Imported remote updates can remain pending outside the applied oplog. This adds a thin LoroDoc::export_pending_updates() wrapper and an optional-bytes UniFFI method so callers can persist those updates alongside a consistent ordinary snapshot and restore both through normal import.

The Rust return type is Result<Option<Vec<u8>>, LoroEncodeError>; generated Swift returns throws -> Data?, and Python returns Optional[bytes]. Rustdoc, generated-language documentation, and README explain empty results, preserving the previous checkpoint on errors, coordinated saving, and missing-dependency limits. Pending export does not commit local edits or establish synchronization.

The dependency is now the actual crates.io loro 1.17.0 release, replacing the temporary review Git pin. Four core crates are 1.17.0; three independently versioned core dependencies retain their versions. No unrelated locked dependency changes. The released 1.16.2 fixes are retained, resolving the reviewed downgrade blocker.

Core 1.17 compatibility adds the new typed errors at the end of the UDL enums while preserving existing tags and legacy JSON method signatures. Fallible methods remain additive. Tests cover typed errors through real generated bindings, snapshot-at deleted-container history, and recovery after errors.

Final head: f3f20d1f238d14adc0239f549e423ce63d24f0f9, based on 0d215246d52540147edea7d38d3e50ceabbe017e. Independent review confirmed the exact seven Git-to-registry lock transitions, unchanged features, unchanged old-tag protection, and no dependency downgrade or unrelated drift.

Validation uses the default registry manifest and lock, no local-core override, Rust 1.98.1, and --locked: 2 Rust unit tests, 10 integration tests, 8 doctests, 10 Python tests, and compiled/executed Swift restoration and typed-error checks all passed. Format, Python syntax, and diff checks passed.

Rust core 1.17.0 is published and its registry tarballs/API/source hashes are verified. This PR does not publish a new FFI crate, Swift artifact, or Python distribution.

Related: core #1220, Rust release #1221, website #54.

Add optional pending-update bytes and preserve typed encoding errors across UniFFI.
Pin the core review commit and cover Rust, Python, and Swift recovery behavior.

Model: gpt-6.1-sol
Pin the reviewed core commit containing the published 1.16.2 baseline.
Preserve legacy JSON signatures and schemas, expose fallible alternatives,
and map new decode and unreadable-history errors without changing old tags.

Validate deleted-container history recovery and Rust-to-native error conversion.

Model: gpt-6.1-sol
Replace the review Git dependency with the released registry crate and its locked dependency graph. Document the separate FFI release boundary.

Model: gpt-6.1-sol
@zxch3n
zxch3n marked this pull request as ready for review October 22, 2026 08:49
@zxch3n
zxch3n merged commit ef1d7f4 into main Oct 22, 2026
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