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

Doc awareness #277

Merged
merged 8 commits into from
Oct 10, 2024
Merged

Doc awareness #277

merged 8 commits into from
Oct 10, 2024

Conversation

brichet
Copy link
Contributor

@brichet brichet commented Oct 3, 2024

This PR add an optional awareness on the server side ydoc, to enable it to be aware of transcient state of clients.

Draft until jupyter-server/pycrdt#170 is merged and released.

@brichet
Copy link
Contributor Author

brichet commented Oct 3, 2024

@meeseeksdev please backport to 0.2.x

Copy link

lumberbot-app bot commented Oct 3, 2024

Awww, sorry brichet you do not seem to be allowed to do that, please ask a repository maintainer.

@davidbrochart
Copy link
Collaborator

@meeseeksdev please backport to 0.2.x

Copy link

lumberbot-app bot commented Oct 3, 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 0.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 788e0b9c67d4956437654f074da5ad86197036c9
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #277: Doc awareness'
  1. Push to a named branch:
git push YOURFORK 0.2.x:auto-backport-of-pr-277-on-0.2.x
  1. Create a PR against branch 0.2.x, I would have named this PR:

"Backport PR #277 on branch 0.2.x (Doc awareness)"

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.

jupyter_ydoc/ybasedoc.py Outdated Show resolved Hide resolved
@brichet brichet marked this pull request as draft October 3, 2024 12:52
jupyter_ydoc/ybasedoc.py Outdated Show resolved Hide resolved
jupyter_ydoc/ybasedoc.py Outdated Show resolved Hide resolved
jupyter_ydoc/ybasedoc.py Outdated Show resolved Hide resolved
jupyter_ydoc/ybasedoc.py Outdated Show resolved Hide resolved
jupyter_ydoc/ybasedoc.py Outdated Show resolved Hide resolved
jupyter_ydoc/yblob.py Show resolved Hide resolved
jupyter_ydoc/ynotebook.py Show resolved Hide resolved
jupyter_ydoc/yunicode.py Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@@ -31,6 +31,9 @@ def __init__(self, ydoc: Optional[Doc] = None):
self._ydoc = Doc()
else:
self._ydoc = ydoc

self._awareness = awareness
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should just have:

Suggested change
self._awareness = awareness
self.awareness = awareness

And remove the getter and setter as they do nothing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or maybe we should only remove the setter, to make awareness read only, it is not supposed to be set later.
What do you think ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the getter and setter.

jupyter_ydoc/ybasedoc.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
Co-authored-by: David Brochart <[email protected]>
@brichet brichet marked this pull request as ready for review October 9, 2024 14:22
@brichet
Copy link
Contributor Author

brichet commented Oct 9, 2024

It needs a release of pycrdt_websocket for the tests.

jupyter_ydoc/yblob.py Outdated Show resolved Hide resolved
jupyter_ydoc/ynotebook.py Outdated Show resolved Hide resolved
jupyter_ydoc/yunicode.py Outdated Show resolved Hide resolved
tests/test_ydocs.py Outdated Show resolved Hide resolved
@davidbrochart
Copy link
Collaborator

It needs a release of pycrdt_websocket for the tests.

I'll make one.

tests/test_ydocs.py Outdated Show resolved Hide resolved
@davidbrochart
Copy link
Collaborator

It needs a release of pycrdt_websocket for the tests.

I'll make one.

Do you mind reviewing jupyter-server/pycrdt-websocket#76 before?

@davidbrochart davidbrochart added the enhancement New feature or request label Oct 9, 2024
Copy link
Collaborator

@davidbrochart davidbrochart left a comment

Choose a reason for hiding this comment

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

Thanks @brichet, I guess you can remove the "draft" status?

@davidbrochart
Copy link
Collaborator

Oh it's not in draft anymore, let's merge?

@davidbrochart davidbrochart merged commit 877e5b9 into jupyter-server:main Oct 10, 2024
10 checks passed
@brichet brichet deleted the doc_awareness branch October 10, 2024 07:34
@brichet
Copy link
Contributor Author

brichet commented Oct 10, 2024

I'll backport it manually

brichet added a commit to brichet/jupyter_ydoc that referenced this pull request Oct 10, 2024
* Add an awareness in the YDoc on server side

* Test awareness getter/setter

* Depend on pycrdt instead of pycrdt_websocket

* Apply suggestions from code review

Co-authored-by: David Brochart <[email protected]>

* Apply suggestions from review

Co-authored-by: David Brochart <[email protected]>

* Apply suggestions from code review

Co-authored-by: David Brochart <[email protected]>

* Apply suggestions from code review

Co-authored-by: David Brochart <[email protected]>

* Update pycrdt_websocket for tests

---------

Co-authored-by: David Brochart <[email protected]>
Co-authored-by: David Brochart <[email protected]>
brichet added a commit to brichet/jupyter_ydoc that referenced this pull request Oct 10, 2024
brichet added a commit to brichet/jupyter_ydoc that referenced this pull request Oct 10, 2024
davidbrochart pushed a commit that referenced this pull request Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants