Skip to content

Bump yjs to 13.6.30 (fixes GC crash in applyUpdate)#566

Draft
xrl wants to merge 3 commits into
jupyterlab:mainfrom
xrl:bump-yjs-13.6.30
Draft

Bump yjs to 13.6.30 (fixes GC crash in applyUpdate)#566
xrl wants to merge 3 commits into
jupyterlab:mainfrom
xrl:bump-yjs-13.6.30

Conversation

@xrl

@xrl xrl commented Apr 9, 2026

Copy link
Copy Markdown

Summary

Bumps yjs from 13.6.20 to 13.6.30 and lib0 from 0.2.98 to 0.2.99 in yarn.lock. The semver range (^13.5.40) already allows this — only the lockfile pin changes.

This fixes a crash during applyUpdatetryGcDeleteSetfindIndexSS that throws "Unexpected case" on every page load when collaboration is enabled.

Three bugs in yjs < 13.6.25 contribute:

How we found this

We decompiled the minified yjs bundle in JupyterLab's static assets and traced the error through findIndexSSreplaceStructItem.gcContentType.gc (the full GC hierarchy). The old buggy pattern left.len = math.max(left.len, ...) was present at offset 30350 in the bundle, matching the pre-13.6.30 source.

Reproduction

Any JupyterLab instance with jupyter-collaboration enabled that has accumulated deleted items in a Yjs document will hit this on page load during the initial document sync. The error is caught by the docprovider (console.error("Caught error while handling a Yjs update", e)) so it doesn't crash, but it breaks document sync for the affected document.

Test plan

  • jlpm test — 16 JS tests pass
  • pytest tests/ — 52 Python tests pass
  • jlpm build — all 5 packages build successfully
  • Only version changes: yjs 13.6.20→13.6.30, lib0 0.2.98→0.2.99

The bundled yjs 13.6.20 has a bug in sortAndMergeDeleteSet that mutates
DeleteItem.len in place (yjs/yjs#767), corrupting shared references
used by tryGcDeleteSet. This causes findIndexSS to throw "Unexpected
case" during document sync GC. Fixed in yjs 13.6.30.

Also picks up yjs 13.6.25/26 fixes for iterateDeletedStructs bounds
checking.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Binder 👈 Launch a Binder on branch xrl/jupyter-collaboration/bump-yjs-13.6.30

xrl and others added 2 commits April 9, 2026 13:21
…s 13.6.20

Set `bundled: true` for yjs and y-protocols in both
collaboration-extension and docprovider-extension sharedPackages config.

Without this, the extensions declare yjs as `bundled: false, singleton: true`,
meaning they consume whatever version JupyterLab core provides (13.6.20)
rather than providing the fixed 13.6.30 to the Module Federation share scope.

With `bundled: true`, webpack includes yjs 13.6.30 in the extension build
and offers it to the singleton scope. Since 13.6.30 > 13.6.20 and both
satisfy ^13.5.40, Module Federation picks 13.6.30 for all consumers,
fixing the GC crash in sortAndMergeDeleteSet (yjs/yjs#767).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tall)

The hatch-jupyter-builder hook has skip-if-exists for the labextension
static assets. Without these committed, pip install tries to rebuild
from source which requires Node.js — unavailable in the notebook Docker
image. Force-adding these gitignored files lets pip install use the
pre-built JS directly.

Built with yjs 13.6.30 and bundled:true, so Module Federation provides
13.6.30 to the singleton scope.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@krassowski krassowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR cannot be merged as it includes files which should not have been committed, and extensive changes to yarn.lock beyond what is necessary. I am happy to merge a PR bumping yjs version but it shuld be a minimal self-contained change.

@krassowski krassowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commits generated files which should not be committed. It also makes changes to bundling without explanation and containe unnecessary changes in the yarn lock file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants