-
-
Notifications
You must be signed in to change notification settings - Fork 43
Respect autosave setting in RTC backend #479
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c9d8dc8
initial-try
Darshan808 789c874
prevent-always-autosave
Darshan808 40fba54
fix-unused-import
Darshan808 19a0335
check_for_manual_save
Darshan808 45b9ec2
force-autosave-by-default
Darshan808 cecb9eb
Merge branch 'main' into fix-autosave
Darshan808 de5267e
remove-force-autosave
Darshan808 28c1ac9
fix-type-hints
Darshan808 72fd92b
fix-autosave-in-tests
Darshan808 7e84bf8
add-tests
Darshan808 6b94adb
follow-y-protocol
Darshan808 9ddd24d
add-update-value
Darshan808 cd23070
refactor-code
Darshan808 518fec4
use-decoder
Darshan808 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
class MessageType(IntEnum): | ||
SYNC = 0 | ||
AWARENESS = 1 | ||
RAW = 2 | ||
CHAT = 125 | ||
|
||
|
||
|
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this also include
autosaveInterval
?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should also send the
autosaveInterval
to the backend?The reason I ask is that currently, JupyterLab (frontend) automatically calls
save
after everyautosaveInterval
, which in turn triggerssave_to_disc
on the backend.However, the current implementation is that when autosave is enabled, the backend saves the document to disk on every document change, regardless of the configured autosave interval.
If we want to respect the autosave interval properly, I think we could consider removing the
_on_document_change
function on the backend.jupyter-collaboration/projects/jupyter-server-ydoc/jupyter_server_ydoc/rooms.py
Lines 235 to 237 in 9059310
Here's why:
save
at the configured interval, which will triggersave_to_disc
. Thus, observing document changes on the backend may also be redundant in this case.One potential caveat is that if multiple clients with different
autosaveInterval
values are connected to the same document,save_to_disc
will still be called for each of them when their individual autosave timers trigger.Would love to hear your thoughts on this approach and whether you see any concerns or alternatives.
CC: @davidbrochart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should move the discussion to a new issue and address this in a separate PR?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is reasonable. We could create a new issue after this PR gets merged.