Skip to content

feat: upgrade Univer SDK to 1.0.0 and .univer to v3 - #55

Merged
OTime-Coder merged 6 commits into
mainfrom
codex/upgrade-sdk-1.0.0
Sep 24, 2026
Merged

OTime-Coder merged 6 commits into
mainfrom
codex/upgrade-sdk-1.0.0

Conversation

@OTime-Coder

Copy link
Copy Markdown
Member

Summary

Upgrades the Univer / Univer Pro / Collaboration SDK cohort from 1.0.0-rc.0 to 1.0.0 and moves .univer to format v3 (core 2, worktree 3, assets 1, history 2), matching the SDK 1.0.0 SQLite persistence contract.

  • Dependencies: bump the SDK cohort to 1.0.0; add a React 19.3.0 override in pnpm-workspace.yaml.
  • Adapters:
    • Unit records persist creatorID / createdAt.
    • Core and Worktree adapters write createTime in Unix seconds on commit and store the same time in the new changeset created_at_ms column.
    • The History adapter stores segment starts in collaboration_history_records, with the SDK index names and origin: 0 meaning "any origin".
  • Migration: v0, v1 and v2 files upgrade to v3 through the existing backup → candidate → verify → atomic replace pipeline.
    • Default creators and missing change times follow the SDK migrations. The creator is the rc History revision 1 author, otherwise anonymous. A missing trunk createTime takes the rc History commit time, and any other missing time takes the upgrade start time.
    • rc History segment starts are kept, with an added revision 2 start. Starts beyond the core head are dropped, and a Unit with inconsistent rc History has its History cleared so History Service rebuilds it lazily.
    • v2 sources skip the legacy Base content repair.
  • Gateway:
    • Worktree creation fills creator fields from trunk Unit records.
    • The optimizer uses reader and clears History records when it squashes revisions.
    • The startup History reconciliation is removed. Upgrades and the optimizer now guarantee there are no History starts beyond the core head.
  • CLI: the upgrade notice reports the target format.
  • Docs: docs/data-compatibility.md gains the format table and the v2 → v3 rules.

The frozen rc.0 fixtures come from #54.

Test plan

  • pnpm check (format, lint, typecheck, locales, all package tests, pack check)
  • v2 fixture upgrade: creators, change times, created_at_ms, History boundaries, inconsistent History, and failure leaving the source byte-identical
  • built-bin end-to-end: upgrade a v2 file, edit in the draft Worktree, ready, merge, inspect trunk

OTime-Coder and others added 6 commits September 24, 2026 17:10
Co-authored-by: Cursor <cursoragent@cursor.com>
…SDK 1.0.0

Persist Unit creatorID/createdAt, store changeset createTime in Unix seconds,
and replace the per-revision History index with SDK segment boundaries.
History Service now indexes from collaboration events, so Gateway startup
only drops boundaries beyond the trunk head.

Co-authored-by: Cursor <cursoragent@cursor.com>
v3 is core@2, worktree@3, history@2. The v2 reader adds Unit creators,
normalizes millisecond or missing createTime values to seconds, and converts
rc History to segment starts, dropping only inconsistent Units for lazy
rebuild. Covers the frozen rc.0 fixture in package and built-bin tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Upgrades drop History boundaries beyond the Core head and the optimizer clears
History when it squashes revisions, so v3 files never need the startup reset.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add created_at_ms to both changeset tables, follow the SDK migrations for
default creators (History rev1 or anonymous) and missing change times, treat
History origin 0 as unfiltered, and require complete history@2 in v3 detection.

Co-authored-by: Cursor <cursoragent@cursor.com>
Write created_at_ms from Date.now() and store payload createTime as its
whole seconds, so the column no longer drops the sub-second part.

Co-authored-by: Cursor <cursoragent@cursor.com>
@OTime-Coder
OTime-Coder merged commit 65879e5 into main Sep 24, 2026
2 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