Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional origin to transaction, filter out 'modeldb' origin #246

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

davidbrochart
Copy link
Collaborator

In jupyterlab/jupyterlab#16498 JupyterLab will handle cell outputs in a better way. Previously, the assumption was that only the frontend could modify a document (apart from the initial loading), but with server-side execution this is not true anymore. Thus changes to the Y model must be observed and modelDB must be changed accordingly. But in turns, changes to modelDB must also be applied to the Y model, so in order to break this circular dependency, we must use Yjs's origins to not apply a change initiated by modelDB to modelDB again.
In this PR, the origin that identifies a change from modelDB is the string "modeldb". A change with this origin will not emit a change signal.

@davidbrochart davidbrochart added the enhancement New feature or request label Jun 27, 2024
@Zsailer
Copy link
Member

Zsailer commented Jun 28, 2024

Looks good to me @davidbrochart. Thanks!

@Zsailer Zsailer merged commit 58d8e41 into jupyter-server:main Jun 28, 2024
10 checks passed
@davidbrochart davidbrochart deleted the origin branch June 28, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants