# Editing wiki posts at same time as someone else sometimes loses revisions

**URL:** https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741
**Category:** Feature
**Tags:** composer, wiki-posts
**Created:** [03.Июль.2015 03:48:04 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741 "2015-07-03T03:48:04Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Daniel\_M](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Daniel\_M](https://meta.discourse.org/u/Daniel_M)
#### Post date: [03.Июль.2015 03:48:04 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/1 "2015-07-03T03:48:04Z")

</div>

When two people edit wiki posts at once, someone always overrides another person’s post. How hard would it be to have a google docs-style of editing, where it doesn’t override? Alternatively, a functional merge would be nice, while a lock, even though it is better than nothing, is not the best option (as is discussed in [Edit lock when editing posts; especially wiki post](https://meta.discourse.org/t/edit-lock-when-editing-posts-especially-wiki-post/24769)).

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [03.Июль.2015 05:50:45 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/2 "2015-07-03T05:50:45Z")

</div>

One thing we could do through the message bus is alert people when they begin editing and someone else is already editing. On wiki posts I mean, moderator collisions on edits have to be absurdly rare.

I resisted this for Stack Exchange, instead we did a “whoever made the longer set of edits wins” hack, but we have the systems in place to do real time notifications in Discourse.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [03.Июль.2015 11:39:31 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/3 "2015-07-03T11:39:31Z")

</div>

> [@codinghorror](#):
>
> On wiki posts I mean, moderator collisions on edits have to be absurdly rare

We’ve been running into this quite a bit with one of our more frequently edited wiki posts. Keep in mind wiki posts are by TL, so it isn’t directly for moderators (ours happens to be “spf staff”, as we have it in a private category, but we still get several of them wondering why their changes suddenly disappeared.

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [15.Август.2017 10:12:39 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/4 "2017-08-15T10:12:39Z")

</div>

FWIW, this issue, along with restricting edit permissions, is preventing adoption of wiki posts on my system. I’ll grant that as a small, private community we may be an edge case.

How does Wikipedia manage this? (Or other such popular systems?)

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [15.Август.2017 14:35:54 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/5 "2017-08-15T14:35:54Z")

</div>

> [@alehandrof](#):
>
> How does Wikipedia manage this? (Or other such popular systems?)

If you care to do some research on that and share your findings that’d be appreciated 😉

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [16.Август.2017 11:52:23 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/6 "2017-08-16T11:52:23Z")

</div>

WIkipedia’s edit conflict workflow is outlined here:

> **[Help:Edit conflict](https://en.wikipedia.org/wiki/Help:Edit_conflict)**
>
> This page discusses edit conflicts, and how to deal with them. To understand what an edit conflict is, consider the following situation:
> At the top of the edit-conflict page is an editing box containing Bob's version of the whole page, even if Alice is doing section editing.
> At the bottom of the edit-conflict page is a second editing box containing the text Alice was going to submit. This will be Alice's version of the page or section she was editing.

My takeaways:

Wikipedia doesn’t indicate when multiple people are editing the same page, as Jeff suggested above. I think is a good idea in Discourse’s case. I’ve seen this model used in MailChimp and other places.

On Wikipedia, after someone tries to save a page, they get an an “edit conflict” page, which gives the user a chance to reconcile the differences manually:

* * *

 ![](https://global.discourse-cdn.com/meta/original/3X/6/7/67ff152b3233dfd5a4089d02f7f7b7b6c595bb8e.png)

* * *

This seems like an intimidating screen, but I think most of the pieces are there already for Discourse, if it seems like a good idea to implement.

A possible spec would be (in order of importance):

1. Indicate when another user is editing the same post.
2. Indicate, when saving, that the edit would overwrite someone else’s work – allowing the user to continue or stop.
3. As above, but also providing a diff between the user’s version and the current version
4. As above, but with the addition of a text editor to allow the user to merge changes manually

1 & 2 seem reasonably easy to implement and would be helpful even without 3 & 4. I’m not sure how the UI would work for 3 & 4.

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [16.Август.2017 12:50:05 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/7 "2017-08-16T12:50:05Z")

</div>

> [@codinghorror](#):
>
> One thing we could do through the message bus is alert people when they begin editing and someone else is already editing

This might be a natural addition to this plugin: [https://meta.discourse.org/t/discourse-who-is-writing-a-reply/48420](https://meta.discourse.org/t/discourse-who-is-writing-a-reply/48420)

Seems like that plugin is in need of an update anyhow, and @adrapereira hasn’t been around for a while. We can sponsor this work if anyone’s interested.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [16.Август.2017 13:25:34 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/8 "2017-08-16T13:25:34Z")

</div>

> [@erlend\_sh](#):
>
> Seems like that plugin is in need of an update anyhow, and @adrapereira hasn’t been around for a while. We can sponsor this work if anyone’s interested.

I might be interested in this once my GSOC project is over in a couple of weeks - the ‘presence’ features are somewhat related to my whos-online plugin. 🙂

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [16.Август.2017 16:55:50 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/9 "2017-08-16T16:55:50Z")

</div>

One other thing that Mediawiki (the Wikipeda software) does is _help prevent conflicts by letting people just edit sections_.

Two people can edit two different sections (eg H1/H2 delimited blocks) at the same time and not see the conflict resolution page afterwards. The talk pages also have an “add new section” feature, which lets a new section be added with no risk of edit conflict.

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [12.Сентябрь.2017 21:57:01 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/10 "2017-09-12T21:57:01Z")

</div>

[https://meta.discourse.org/t/discourse-presence-who-is-writing-a-reply/48420?u=erlend\_sh](https://meta.discourse.org/t/discourse-presence-who-is-writing-a-reply/48420) now supports “who is editing”.

[https://meta.discourse.org/t/discourse-presence-who-is-writing-a-reply/48420/26?u=erlend\_sh](https://meta.discourse.org/t/discourse-presence-who-is-writing-a-reply/48420/26)

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [12.Сентябрь.2017 21:57:07 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/11 "2017-09-12T21:57:07Z")

</div>



---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [13.Сентябрь.2018 00:42:22 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/12 "2018-09-13T00:42:22Z")

</div>



---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [13.Сентябрь.2018 00:49:30 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/13 "2018-09-13T00:49:30Z")

</div>

I am reopening this cause the underlying problem still exists, even with presence. Sure we show that two people are editing. But only one person wins now and another loses.

We can sort this out very cleanly if our edit API always includes “this is the revision I expect to be it” with the payload and raises if the revision does not match.

So the process would be:

User A: starts editing (revision is 1)  
User B: starts editing (revision is 1)  
User A: hits save (current revision is 1) → 200  
User B: hits save (current revision is 1) → 409  
User B: presented with “It looks like the post was updated since you started editing, save anyway? (Yes, No)”

In theory we could do automatic conflict resolution as well which could make the wiki use cases a bit stronger. (calculate diff based off revision, and attempt to apply it to latest)

I do not want to gold plate the feature for the next release with full on conflict resolution windows proposed bye @alehandrof, that can come later. But at least saying “on no, you are going to nuke someone’s edit” would be nice.

Overall, the issue is a lot more of an issue if the community have lots of wiki topics.

---

<div class="post-metadata">

### Author: ![danekhollas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danekhollas/32/79637_2.png) [@danekhollas](https://meta.discourse.org/u/danekhollas)
#### Post date: [13.Сентябрь.2018 06:45:44 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/14 "2018-09-13T06:45:44Z")

</div>

That would be awesome, thanks so much!

Just stating the obvious here: one thing that kinda helps is to spread larger wiki post into several smaller ones and perhaps linking them together in the OP.

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [15.Сентябрь.2018 09:10:21 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/15 "2018-09-15T09:10:21Z")

</div>

This might be a silly idea, but what about pre-empting a revision number whenever the editor is fired, so that both revisions can be saved, and then after the conflict resolution can happen? If there’s no save, the revision can be dropped as a no-op.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [16.Сентябрь.2018 23:02:21 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/16 "2018-09-16T23:02:21Z")

</div>

I worry cause effectively edits still get nuked for somebody and on large wikis it is very unlikely you would notice it till too late.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [31.Октябрь.2018 14:50:03 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/20 "2018-10-31T14:50:03Z")

</div>

@nbianca added a safeguard 💂

[https://github.com/discourse/discourse/commit/f60b10d090171c49134b20abcfb089ebb94fad21](https://github.com/discourse/discourse/commit/f60b10d090171c49134b20abcfb089ebb94fad21)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [01.Ноябрь.2018 00:03:40 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/21 "2018-11-01T00:03:40Z")

</div>

@nbianca can you add a cropped screenshot of this in action? That’d be 🆒

---

<div class="post-metadata">

### Author: ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)
#### Post date: [01.Ноябрь.2018 13:37:50 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/22 "2018-11-01T13:37:50Z")

</div>

Sure! 728 screenshots below 😉

[https://global.discourse-cdn.com/meta/original/3X/2/1/216490b869b2902bbc7ba335698207cf12052aa7.mp4](https://global.discourse-cdn.com/meta/original/3X/2/1/216490b869b2902bbc7ba335698207cf12052aa7.mp4)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [01.Ноябрь.2018 19:34:52 UTC](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741/23 "2018-11-01T19:34:52Z")

</div>

I see, I was hoping for a are you sure kind of prompt here vs this flow

[Next page](https://meta.discourse.org/t/editing-wiki-posts-at-same-time-as-someone-else-sometimes-loses-revisions/30741.md?page=2)
