Files
DarkSky c471cfc9a5 feat(core): improve sync protocol (#15854)
#### PR Dependency Tree


* **PR #15854** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Added workspace document lifecycle tracking, including trashed and
deleted states, with migration support.
* Added workspace inventory syncing and state refresh across cloud and
local storage, improving document discovery and offline synchronization.
* Added clearer messages for invalid or oversized document updates and
temporarily unavailable sync or validation.
* Added paused-upload diagnostics and a Quick Export shortcut for
relevant workspace sync issues.

* **Improvements**
* Search, indexing, and document metadata now reflect workspace
inventory and lifecycle state.
* Restoring from history preserves concurrent edits made during
recovery.
* Unused-blob checks now scan document content and detect changes during
scanning.

* **Bug Fixes**
* Invalid document updates are rejected without partially saving a
batch.
* Document reading handles missing or cyclic block relationships more
reliably.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-16 19:37:14 +08:00
..
2026-09-20 13:01:49 +08:00

Affine Blocksuite format YDoc reader

Usage

read rootYDoc

import { readAllDocsFromRootDoc } from '@affine/reader';

const docs = readAllDocsFromRootDoc(rootDoc);
console.log(Array.from(docsWithTrash.entries()));

// [
//   'doc-id-1', { title: 'test doc title' },
//   // ...
// ]

read YDoc

import { readAllBlocksFromDoc } from '@affine/reader';

const blocks = readAllBlocksFromDoc(doc);