The search extractor did not read inline `reference` attributes in rich
text, so a doc that links to another doc only through an inline mention
did not show as a backlink. It also dropped `prop:params` of linked and
synced doc embeds, and it did not index database columns, table cells
or LaTeX.
- Read the `reference` attribute of the visible runs in `prop:text` of
paragraph, list and code blocks. Parse each `reference` format once,
so a long run of text under one reference costs linear time.
- Keep `ref` unique by its full string and push the `pageId` of each kept
`ref` to `ref_doc_id`, so the two lists stay in step. Check database
cells one at a time, as the reader does.
- Serialize `ref` as `JSON.stringify({ docId, ...params })`. Spread
strings and arrays by index, put index keys first, and format numbers
as ECMAScript does.
- Keep only the `docId` when the params are larger than 256 KiB, nest
too deeply, have too many entries, or pass the 16 MiB budget of the
block. Check duplicates by the hash of the full reference, so such a
reference does not merge with a different reference to the same doc.
- Merge `prop:params` into the `ref` of `affine:embed-linked-doc` and
`affine:embed-synced-doc`, and keep an empty `pageId`.
- Index the database title, column names and select options from `Y.Map`
columns. Read cell references from `Y.Text` or from boxed text with a
truthy marker. Add `databaseName` to database blocks and row paragraphs.
- Read the text of each flavour as the old server does. Read rich text
only from `Y.Text`. Index the table cells in key order and the LaTeX
source.
- A note, frame or edgeless text with no text of its own joins the
text of its direct children, up to 1 MiB. Each child gives its text to
one container only.
- Index no text for doc embeds and bookmarks. Skip blocks with only
white space, and keep bookmark blocks.
- Raise `SCHEMA_FINGERPRINT` to 2, so that startup builds a new generation
and reprojects docs that did not change. Retire drained generations of
any schema version.
- Move the `TestDoc` builder to `tests/support`. Test each flavour, the
params spread, malformed input, the time for many runs and references,
backlinks through `search` and `aggregate`, and the schema upgrade.
- Upgrade `y-octo` to `0.4.2` (`y-octo-core 0.1.1`) in `packages/backend`
and add `y-octo-core` to `server-sync` and `server-domain` for write-boundary
v1 scanning.
- Reject new zero-length struct updates in `server-sync::storage::validate_doc_update`
and `server-domain::workspaces::create_workspace_with_init` via
`y_octo_core::decoder_v1::decode_update_v1` while keeping persisted
historical zero-length reads intact.
- Align workspace lifecycle root-doc decoding to `WORKSPACE_LIFECYCLE_MIGRATION_READ_LIMITS`
(`max_structs = 16_000_000`), propagate `ReadError::ResourceLimit` before
committing `storage_reconciliation_checkpoints`, and preserve the
`[affine-doc:resource_limit]` marker in `server-domain::doc_sharing`.
- Keep `ReadError::IncompleteSnapshot` fallback to `Doc::try_from_binary_v1`
in `server-sync` and `server-domain` while enforcing `ReadLimits`.
- Add regression tests for cross-frame zero-length poisoning, workspace init
zero-length rejection, legacy zero-length recovery, multi-client clock gaps,
alias `ResourceLimit` markers, and lifecycle `ResourceLimit` rollback plus retry.
Refactor document compaction and search projection to remove cross-workspace lock contention and hold zero locks during CRDT merges.
Document compaction and user deletion changes:
- Replace single-transaction compaction with lock-free reads, owned-permit blocking CRDT merges, and short strict-CAS write transactions.
- Retry compaction on snapshot or update CAS mismatches and PostgreSQL 40P01 deadlocks.
- Replace full-table pending update grouping with a rotating primary-key loose index scan and per-batch quota cache.
- Delete owned personal workspaces in individual short transactions with post-lock Team verification and partial cleanup returns.
Connection, rate-limit, and test harness changes:
- Set default statement and idle transaction timeouts on dedicated PostgreSQL session connections.
- Run deferred invite rate-limit effects only after rejected invite transactions roll back cleanly.
- Pass prebound SMTP sinks in parity-harness replay tests to eliminate ephemeral port races.
Search projection v6 and pure-Rust runtime changes:
- Add search_projection_v6.sql with per-workspace advisory locks, post-lock mode re-checks, and a 30s pre-expiry dual-lock bridge.
- Skip steady-state workspace_states updates during ordinary document snapshot writes to remove hot-row contention.
- Validate forward-compatible contiguous prefixes in native_schema_migrations during rolling upgrades.
- Add pure-Rust server-search (disabled by default) with committed marker-XID fences, deferred GC progress retention, repeatable-read ACL snapshots, and GraphQL resolvers.