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 lock id to node for collaboration in documents #1558

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Andronimo
Copy link

This is a proposal for a locking mechanism for nodes to allow collaboration in a network document.
I use 32 bit of the readonly property in the sqlite database for a lock id, which tells us who locked the node. The id is created on the first startup of cherrytree and stored in the config.
You can acquire/release the lock of a node in the tree popup menu. If another user holds a lock on a node or a parent node it's like a readonly node for user users.

TODO:

  1. visualization of locked nodes
  2. restrict operations on locked nodes (e.g. hierarchy changes are not allowed if you don't have a lock on the parent)
  3. save document after user changes a lock
  4. read locks from other users when document on disk changes
  5. ...

@giuspen
Copy link
Owner

giuspen commented Mar 16, 2021

Interesting, I would rather use an external file for lock/unlock though and not the document file itself, this way would work for all the 4 document types...

@giuspen
Copy link
Owner

giuspen commented Mar 16, 2021

Oh you talk about nodes sorry I thought the whole document

@Andronimo
Copy link
Author

Yes the idea is that all team members can work in the same document. We often need this for software design or requirement engineering.
This can be done by locks on nodes. Content changes on subnodes and hierarchy changes on the same level have to be restricted.

@giuspen
Copy link
Owner

giuspen commented Mar 17, 2021

Have you tested the same SQLite database opened from multiple terminals/people and written concurrently from multiple terminals/people?
I haven't investigated yet but I suspect that SQLite does not support that

@Andronimo
Copy link
Author

I tested it on an nfs drive with all machines running Ubuntu and it worked quite well. When a process was writing to the database, another process returned that the database is locked.
Nevertheless it highly depends on the used network share implementation. There are buggy NFS versions out there and on cifs the database appears to be always locked.

@ajaxStardust
Copy link

(sorry to chime in like this. new to GitHub in the context of collaboration. probably a faux pas)

I just wanted to say it's impressive the power / potential energy in CherryTree, and this proposal is a great idea!
:)

@giuspen
Copy link
Owner

giuspen commented Sep 24, 2023

It is in the plans in future to support some kind of collaborative edit on the new document type multifile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants