Bump yjs to 13.6.30 (fixes GC crash in applyUpdate)#566
Draft
xrl wants to merge 3 commits into
Draft
Conversation
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>
Contributor
…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
requested changes
Apr 10, 2026
krassowski
left a comment
Member
There was a problem hiding this comment.
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
requested changes
Apr 30, 2026
krassowski
left a comment
Member
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
applyUpdate→tryGcDeleteSet→findIndexSSthat throws "Unexpected case" on every page load when collaboration is enabled.Three bugs in yjs < 13.6.25 contribute:
iterateDeletedStructsiterates past known struct bounds (no clock guard)iterateDeletedStructssortAndMergeDeleteSetmutatesDeleteItem.lenin place instead of creating a new object (mergeDeleteSetsmutates delete sets, causes snapshot comparison to fail yjs/yjs#767), corrupting shared references used by GCHow we found this
We decompiled the minified yjs bundle in JupyterLab's static assets and traced the error through
findIndexSS→replaceStruct→Item.gc→ContentType.gc(the full GC hierarchy). The old buggy patternleft.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-collaborationenabled 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 passpytest tests/— 52 Python tests passjlpm build— all 5 packages build successfully