BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
15.28k stars 1.9k forks source link

Feature: Collaborative editing (at least conflict/locking) #395

Open bios-ben opened 7 years ago

bios-ben commented 7 years ago

Desired Feature: Currently if you have multiple people editing the same document, the most recent person to save just overwrites the other. At the very least this should use lock files and note when there's conflicts or try to auto merge. But the better feature would be to collaborative edit using sockets like other editing tools such as etherpad or hackmd.

Shackelford-Arden commented 7 years ago

While I +1 this, I'd also say that it would be a nice addition to have the option between Check In/Out method and collaborative writing. Some may not want the collaborative ability. Personally I would, but I know my last job would simply want a check in/out functionality.

ssddanbrown commented 7 years ago

Yeah, I can see the benefit of something like this. Collaboration will be hard to do technically, Especially on the current laravel codebase without the app structure getting extra complicated. My concerns with locking is that it kind of relies on the user to lock/unlock which we can the work around with notifications and such but it does add a lot to the system.

At the moment the system will notify upon edit if someone else has started editing but there's nothing forceful in place.

therealscottcarlow commented 7 years ago

Locking or check-in/check-out is going to be necessary for my org at scale. I would love to see this implemented. Collab is OK, but realistically if I wanted to collab on a doc I wouldn't use Bookstack as the platform to do that in. That's my 2 cents.

bios-ben commented 7 years ago

What I'd like to see in an app, if I were to make something ideal from scratch, is to be able to edit a file and choose collaborative, real-time read-only, or private lock. In my org the main thing I want a lot of the time is to have multiple people live viewing the edits as they go in (in final formatted form), while one person is doing the editing using whatever editor (markup, wysiwyg, etc). This allows people to essentially audit the documenting party, while only one person is responsible for actual dictation. I haven't seen software like this, and if I had the cycles/funding I'd build it.

----- Original Message -----

From: "Scott Carlow" notifications@github.com To: "BookStackApp/BookStack" BookStack@noreply.github.com Cc: "Ben" ben@binarysolutions.io, "Author" author@noreply.github.com Sent: Tuesday, 6 June, 2017 12:12:06 PM Subject: Re: [BookStackApp/BookStack] Feature: Collaborative editing (at least conflict/locking) (#395)

Locking or check-in/check-out is going to be necessary for my org at scale. I would love to see this implemented. Collab is OK, but realistically if I wanted to collab on a doc I wouldn't use Bookstack as the platform to do that in. That's my 2 cents. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .

ghost commented 7 years ago

+1 for Check In/Check Out.

Would also need admin level force Check In and probably a way to do that in bulk. Check Out expiration would be nice.

vdavid commented 6 years ago

Re: @ssddanbrown

At the moment the system will notify upon edit if someone else has started editing but there's nothing forceful in place.

Actually, that'd be cool but it doesn't seem to do that. I tested it on the demo site: I logged in with admin, created a guest2 user, logged in as guest2 in a porn window, started editing a page as admin, but when I went there as guest2 there was no indication whatsoever that the page was being edited. I don't know if I should report this as a bug, because I'm not sure if it's broken or just nonexistent.

But yeah, this would be a nice baseline, and a full collaboration feature would be extra awesome (but definitely hard to implement well).

NickeZ commented 6 years ago

I have been using HackMD for a while and got really used to collaborative editing. The use cases I see are for example writing meeting minutes and doing project plan drafts which are easier done as a team effort if everyone can at least live-view the updates (preferably also live edit).

foinus commented 6 years ago

we also need this and it shut also prevent moving pages when somebody is editing them

alexanderrieder commented 6 years ago

we would also appreciate if others at least could not edit the same page while another user is editing it :)

Valiantiam commented 5 years ago

I haven't seen anyone post here for this request in a while. This is a must for any medium sized teams attempting to work on documentation at the same time to prevent conflicts and lost data and time.

bios-ben commented 5 years ago

Fun fact, CKEditor 5 provides this feature out of the box now and is quite polished.

ssddanbrown commented 5 years ago

I don't believe the collaboration components of CKEditor5 are open-source and, Even then, it would still require some considerable wiring to the back-end.

I've been keeping an eye on prosemirror as a potential way to combine the WYSIWYG & Markdown editors and at least provide some kind of route to collaboration. Lots of potential work and issues to journey that path though.

Valiantiam commented 5 years ago

That looks somewhat promising. Again, Ideally, even if we just had a way to "lock" editing to one user at a time, so information is not overwritten by two people trying to write to the same document/page etc.

rdnaskelz commented 5 years ago

Is there any kind of a roadmap or at least a plan to implement collab editing at this moment? @ssddanbrown have mentioned prosemirror which looks nice but is there something devs are doing to make this happen? 🙂

ssddanbrown commented 5 years ago

@Rdnaskel Not right now, Only a faint plan in my mind. Will be a fairly large undertaking that will require the two editors in BookStack to be better aligned first.

I've been thinking how to achieve the locking component recently. I don't want to do it in a way which will really hinder usage, for example where you'd often need to get an admin to unlock. Will probably look to have a polling system to show active editing (Or base it on autosave times) then have a global timeout (~1hr default, instance-level configurable). Will maybe look to quickly implement this not long after the redesign, if I remember.

kartha10 commented 5 years ago

+1

farfalk commented 4 years ago

Hi everyone, we're using bookstack in our infrastructure. This feature would be extremely useful, especially with an hackmd-like ux. I'd like to know, if it's possible of course, how could I as a programmer / we as a company help in implementing it or accelerate its development.

jstiops commented 3 years ago

hi, how are things going with this? I'd rather have a simple locking mechanism for an admin to switch on/off than have nothing like currently is the case. Or perhaps at first don't actually lock but just give a warning or something when opening a page for editing when it's already being edited. It's seems just a bit weird to not have -something- when bookstack is used in a team.

Hazzard17h commented 3 years ago

Maybe you could be interested in this pull request: https://github.com/BookStackApp/BookStack/pull/1862 It is based on version 0.29.3, I had not rebased it afterwards.

OkoGoran commented 3 years ago

Hello there! I also wonder if there is any plan to integrate this feature somehow. At least a warning is a killer-criteria. Otherwise one of two people who are working on the same page will loose all it's content, without even noticing it.

Valiantiam commented 3 years ago

Yeah considering the response here I understand not wanting to add collaboration.

But as @OkoGoran said, we do need then some sort of warning that someone else is editing, or even a lock period, where a page is locked when someone else is editing. This would also introduce a couple other issues that would need to be addressed. Such as if you want to edit a page someone kept open for edit on accident... you'd need a way to time that other person out, or allow the next person to force the other persons work to save, and close, so you can keep editing, but all the potential work of the other person doesn't get lost. There are a few different ways to tackle that issue I'd imagine.

ssddanbrown commented 3 years ago

@Valiantiam Just to confirm, my comments there were in regards to sharing the existing draft system. Collaborative editing is different and something I would like one day, it's just a lot tricker to implement.

At least a warning is a killer-criteria

@OkoGoran You should get a warning if you start editing a page that another user has started editing (Or saved a draft for) in the last hour. You should also get a warning if you start editing one of your drafts where the page has since been saved.

Otherwise one of two people who are working on the same page will loose all it's content, without even noticing it.

@OkoGoran It can be hard to notice overwrites, But the content should not be lost. If two people save the same page with different content, you should still have the content for both saved as revisions so you can always see/revert as required.


Just to confirm the status of things, A review of alternate page editors is upcoming on the roadmap. Collaborative editing compatibility will be considered during that phase. There are other technical/support hurdles along the way, but the editor is one of the biggest.

tmanok commented 3 years ago

1+ to making this happen. Confluence Server just fell off a cliff, I really need an alternative and Book Stack was under consideration a while back. I'm hoping that I can migrate over a hundred people somewhere and they need collaborative editing. I would also consider hiring a developer next year to support any open source projects that the company uses, including Bookstack if things turn out. Just for reference on the check-in check-out process, Confluence for example was able to have a page "saved" or "published" while another user was editing, essentially allowing the continued editing of the draft, but the page outside of the editor would be updated to whatever was in the document when one of the contributors pressed that "Saved" button. This was a great feature, but checking out or "saving" wasn't necessary either, it could be left as a draft and picked up the following morning with all of the changes left in the unpublished draft. Hope that helps provide some functionality insight into what other software has previously done. Thanks!

nikkilocke commented 3 years ago

+1 to this.

Just to throw some wild ideas into the mix

If user A edits something, then user B edits the same thing at the same time.

christoferw commented 3 years ago

i think we should use some kind of websockets, e.g. https://beyondco.de/docs/laravel-websockets/getting-started/introduction to enable real time coloboration

Viele GrĂĽĂźe aus Coesfeld

Christofer


Dipl. Ing. Christofer Wesseling Geschäftsführer 02541 / 880 - 117 cw@weslink.de

WESLINK GmbH Goxel 33b 48653 Coesfeld www.weslink.de

eBusiness Softwareentwicklung Frontend | Backend | Consulting

Sitz der Gesellschaft: Coesfeld | Amtsgericht Coesfeld HRB 17888 | Geschäftsführer: Dipl. Ing. Christofer Wesseling DE: Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. EN: This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Am Fr., 5. Feb. 2021 um 15:45 Uhr schrieb Nikki Locke < notifications@github.com>:

+1 to this.

Just to throw some wild ideas into the mix

  • could you leverage git somehow for merging changes when two people edit at the same time?
  • Nextcloud has collaborative editing of markdown files, which works pretty well

If user A edits something, then user B edits the same thing at the same time.

  • When they save, which version becomes the live page - is it the most recent save?
  • Do both versions make it into the history?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BookStackApp/BookStack/issues/395#issuecomment-774075276, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACI37FEHNM5UAZSN5FE36LS5P77TANCNFSM4DLHIIDQ .

tmanok commented 3 years ago

+1 to this.

Just to throw some wild ideas into the mix

  • could you leverage git somehow for merging changes when two people edit at the same time?
  • Nextcloud has collaborative editing of markdown files, which works pretty well

If user A edits something, then user B edits the same thing at the same time.

  • When they save, which version becomes the live page - is it the most recent save?
  • Do both versions make it into the history?

Hey Nikkilocke,

I think that being able to edit documents together collaboratively is the goal. Being able to see text the moment another person adds it to the document in the document editor is very important feature. If you've never encountered this before, consider the collaborative editing found in Google Docs or Confluence. There is an indication of who is currently viewing the document and all parties can see what changes are being made live. This all depends on the permissions for the document however, inheriting space permissions would mean that new documents are visible to any permitted users of the space, but that could be easily changed by the document's owner.

I like Christoferw's suggestion of using websockets, though I'm not technically proficient enough to contribute code for it.

Thanks,

Triston

Redsandro commented 3 years ago

@ssddanbrown commented:

@OkoGoran You should get a warning if you start editing a page that another user has started editing (Or saved a draft for) in the last hour.

I don't see this when editing with two different users on two different incognito windows of Google Chrome using BookStack 21.04.3 for testing purposes.

My BookStack is set to Markdown mode, not WYSIWYG mode. Is that relevant?


Google brought me here. I have this problem where someone overwrote someone elses contribution. Only happened once, but I've only been using BookStack for a week.

bamhm182 commented 3 years ago

I'm only seeing it sometimes. I created a page and made edits, then I saved it and started editing it again. I had a team member try to edit it and he did not see the popup. He saved his work and I saved mine. My work clobbered his work. I went to edit again, and it told me that he had edited it.

I would really prefer to see an option that would hard lock a page if there's a draft.

MatthieuParis commented 3 years ago

You see a warning when opening the editor only if the other user editing the same page has already saved a draft.

Here is a pull request adding a warning each time a draft is saved: #2877.

Atn-D commented 2 years ago

Hello, I was looking at the CKeditor5 website and realized that it is possible to implement real-time collaboration!

If it can give some tracks for this issue.

https://ckeditor.com/collaboration/real-time-collaborative-editing/

ssddanbrown commented 2 years ago

@Atn-D I'm not sure the real-time collaboration components and protocol are fully open source. Even if it was, The CKeditor5 licence is not compatible for our usage. That's ignoring the general effort and compatibility considerations with switching from the existing editor.

HackingWolpertinger commented 1 year ago

without wanting to get on anyone's nerves, is there any news yet on the plans for collaborative editing in bookstack? Are there plans to include, for example, an Etherpad-like solution? I think bookstack is cool and that would make it even more practical in my eyes.

benjamindonze commented 1 year ago

Hello +1 on this. For me it's almost a showstopper that 2 users can actually change a page and overwrite each other with no error message. It makes collaboration almost not possible. We are currently selecting a wiki tools and for us this is possibly going to force us to another solution.

At very least optimistic locking should be implemented so that if 2 users edit at same time the first one who save success but the second one fail with error message informing that another version was created in the mean time.

mi-wulf commented 1 year ago

@ssddanbrown Are there still plans to create at least a lock feature while editing? Otherwise people are constantly overwriting each others content. While testing I mentioned you get a message, but I dont think that is enough(and I think you get the first message after a minute when the auto save draft kicks in), for example in most CMS/DXP systems you get a message box if someone else already working on a draft and you can decide if you want to edit anyway or discard.

If there are no plans to implement a lock system or a collab system is there a recommendation how to implement a lock system?

ssddanbrown commented 1 year ago

@mi-wulf I've never had any solid plans tbh. As I alluded to in my original, now half-decade old :fearful: comment, I'm not really a fan of locking and that user flow of unlocking/locking, it feels somewhat corporate, putting process over UX which I'd want to avoid, upon the maintenance of those systems.

From my point of view, I wouldn't want to add specific process/features for this right now since, based upon user feedback and desires over the years, I see us longer term moving towards a more significant/formal draft/publish flow which will change up and drive requirements in this area.

For the shorter-term, If this is genuinely an active problem right now though we could instead look to make further changes to add a little more friction in these scenarios. I'm thinking along the lines of:

Happy to hear feedback in regards to whether those would help, or other potential easy-wins.


Thought I'd address my 2021 comment regarding collaboration while I'm here. The summary is that the mentioned editor review was a bad time and didn't go in the direction I wanted, which has since dampened my spirits in regards to live collaboration.

benjamindonze commented 1 year ago

As said above a very simple and minimal implementation would be optimistic locking.

When you save the modification on a page you also send the timestamp (or any version ID) of the version you based your modification on. If another user has modified the page in the meantime (you can check that based on version ID) then an error message is displayed saying the page was modified in between. From there you can maybe offer to user either to cancel or to override the changes but at least user is informed.

mi-wulf commented 1 year ago

@ssddanbrown While I prefer stricter locking system where the you get a locked message and you can only create a new draft if the active drafts are discarted or published by the user currently editing you mentioned features would help a lot to advance in this topic.

Require active continue confirmation upon dual editing rather than just a passive message.

_Here a message box like @benjamindonze mentioned would be nice. In the message box that pops up should be the information who is currently editing(has the open draft) and the age of the existing draft, something like "There is currently a draft open from user , the draft was created ." Then I have the possability to get in contact with that person.

Create an early draft upon edit so that another "active editing session" is considered from point-of-edit rather than ~30s after first changes made.

So here the draft should be created by clicking on edit and maybe use the way @benjamindonze explained with the date.

mi-wulf commented 1 year ago

@ssddanbrown Any idear when something like that could be implemented?

fitterfizzle commented 1 year ago

@ssddanbrown has there been any progress on this?

LHBL2003 commented 11 months ago

We also have the problem that sometimes 2 people work on it. We would also be happy about this function.

LHBL2003 commented 11 months ago

Yeah, I can see the benefit of something like this. Collaboration will be hard to do technically, Especially on the current laravel codebase without the app structure getting extra complicated. My concerns with locking is that it kind of relies on the user to lock/unlock which we can the work around with notifications and such but it does add a lot to the system.

At the moment the system will notify upon edit if someone else has started editing but there's nothing forceful in place.

Is there a notification that someone else is also working on the same page? We don't see anything anywhere. But either I'm misunderstanding the post or there used to be this function?

It would be enough for us to know that someone else is also currently in edit mode.

dmoebius commented 9 months ago

@ssddanbrown Since #2877 is in place for a couple of years now, wouldn't it be the easiest just to save a draft immediately as soon as the user starts to edit a page, ie. goes into edit mode?!? This way he participates in the messaging implemented in #2877 and gets warning messages right from the start.

kobaz commented 8 months ago

https://etherpad.org/ Etherpad is a highly customizable open source online editor providing collaborative editing in really real-time.

berils commented 6 months ago

Its pretty common, that two colleagues using same page, and making changes. Can we wait for some sort of solution? (online editin, locked file, etc.) BR, Berils.

benjamindonze commented 6 months ago

Anything going on regarding this?

bendem commented 4 months ago

It can be hard to notice overwrites, But the content should not be lost. If two people save the same page with different content, you should still have the content for both saved as revisions so you can always see/revert as required.

Technically, your database will handle this for with transactions. When you load the editor, load the current revision number of the page in a hidden field, when saving, check if the latest revision still matches. Since you check the latest revision, save the changes, and insert the new revision in the same transaction, that operation is atomic and cannot fail, the last person to save will fail the check and can be sent back to the editor with an "error" (or a diff view, but that's probably a lot harder).

That method is what most application implement regarding content overwrite. It's a battle tested technique and would solve the current silent overwrite.

If that's not feasible, I'd suggest splitting this issue in two, collaboration is a totally different subject than locking (even if they are somewhat exclusive).

benjamindonze commented 4 months ago

It can be hard to notice overwrites, But the content should not be lost. If two people save the same page with different content, you should still have the content for both saved as revisions so you can always see/revert as required.

Technically, your database will handle this for with transactions. When you load the editor, load the current revision number of the page in a hidden field, when saving, check if the latest revision still matches. Since you check the latest revision, save the changes, and insert the new revision in the same transaction, that operation is atomic and cannot fail, the last person to save will fail the check and can be sent back to the editor with an "error" (or a diff view, but that's probably a lot harder).

That method is what most application implement regarding content overwrite. It's a battle tested technique and would solve the current silent overwrite.

If that's not feasible, I'd suggest splitting this issue in two, collaboration is a totally different subject than locking (even if they are somewhat exclusive).

I agree that it should be splitted in two feature. Most important would first to solve the silent concurrent update issue as proposed with optimistic locking. Then collaboration could be another feature.

BloodyIron commented 3 months ago

@ssddanbrown

I am not entirely 100% up to speed on where this topic is within bookstack, but I want to lend some thoughts that hopefully can turn into something productive.

From what I understand, one of the more tangible concerns on this greater topic is the loss of data between people working on the same document at the same time. That's a very tangible thing and I would dare say we can all agree is legitimate.

There may be other things to this too, but I don't necessarily want to be exhaustive in coverage of the matter at this time.

Something that is perhaps worth for consideration to address this is collaboration of the same document in a shared session so to say. In that, whenever a document is edited, all users that want to edit said document edit the same document session at the same time.

I know of two examples that I'm pretty sure are really great examples of how this could work. Namely within nextCloud:

  1. Draw.io integration
  2. Nextcloud Office (in my case the "CODE" Docker image/container)

For Draw.io, whenever I open a diagram file, I'll see the mouse cursor of any other user (even myself) that also has that same file open. It's actually a bit spooookkkyyy to see my own cursor when I open the same doc up in another window, forgetting I have it literally visible on another monitor, hah! But either way, this is a good example of live collaboration.

For the Nextcloud Office example, you'll see when other users are working on the same document. Where their cursor (as in typing cursor, not mouse cursor) is, will be highlighted with a different colour per user/session, and whatever each person does to the document does not actually interrupt each other.

To me these are both fabulous examples of how collaboration of this nature can be successfully done. I can't speak to the technological mechanisms that make this possible, but I do highly recommend these examples be considered for possible methods that could be used (at least in concept) within Bookstack.

kobaz commented 2 months ago

@ssddanbrown

I am not entirely 100% up to speed on where this topic is within bookstack, but I want to lend some thoughts that hopefully can turn into something productive.

From what I understand, one of the more tangible concerns on this greater topic is the loss of data between people working on the same document at the same time. That's a very tangible thing and I would dare say we can all agree is legitimate. ................

Great writeup here.

In terms of the tech, looks like Etherpad would be capable of doing just that. The good news is that it looks also like the MIT License and Apache License are compatible.

I completely agree on the default behavior to just be jumping straight into a collaborative editing session. If someone wants to privately edit their own version however, the existing drafts system would accommodate.

BloodyIron commented 2 months ago

@ssddanbrown I am not entirely 100% up to speed on where this topic is within bookstack, but I want to lend some thoughts that hopefully can turn into something productive. From what I understand, one of the more tangible concerns on this greater topic is the loss of data between people working on the same document at the same time. That's a very tangible thing and I would dare say we can all agree is legitimate. ................

Great writeup here.

In terms of the tech, looks like Etherpad would be capable of doing just that. The good news is that it looks also like the MIT License and Apache License are compatible.

I completely agree on the default behavior to just be jumping straight into a collaborative editing session. If someone wants to privately edit their own version however, the existing drafts system would accommodate.

To expand on the thought of "private" edit sessions. If we were to reach a position where that functionality is possible (private edit sessions), it might be worthwhile as a setting to allow/disallow shared editing and/or private editing. That way different environments can tune what is on/off to meet their environmental needs. Some environments might want ONLY shared editing on, and no private editing. Some environments might want ONLY private editing. Some might want both! (or none? no editing for you! guess I found a gotcha haha)