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
@fcollonval
Copy link
Member

@meeseeksdev please backport to 2.x

Copy link

lumberbot-app bot commented Nov 29, 2024

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 2.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 58d8e41704b0363bf57bcd6092744d19b0e65792
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am "Backport PR #246: Add optional origin to transaction, filter out 'modeldb' origin"
  1. Push to a named branch:
git push YOURFORK 2.x:auto-backport-of-pr-246-on-2.x
  1. Create a PR against branch 2.x, I would have named this PR:

"Backport PR #246 on branch 2.x (Add optional origin to transaction, filter out 'modeldb' origin)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

fcollonval pushed a commit to fcollonval/jupyter_ydoc that referenced this pull request Nov 29, 2024
davidbrochart added a commit that referenced this pull request Nov 29, 2024
…eldb' origin (#291)

Co-authored-by: Zachary Sailer <[email protected]>
Co-authored-by: David Brochart <[email protected]>
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.

3 participants