Post editing fails sometimes


(Maestro Magnifico) #1

Very critical bug. Posts doesn’t save sometimes when editing. :scream: What happens:

  1. I edit my post, or any other post as moderator.
  2. I press Save Edit.
  3. I see that my post changed for half a second (it jumps on client-side from preview, right?).
  4. Then it updates to old one again.

This happens not often, but sometimes. Just tried to edit FAQ/Guidelines on my forum, pressed Save Edit and here we go again… Shouldn’t there be some kind of error message in case of this? Or retry procedure.


(Jens Maier) #2

Did you check your /logs and browser console?


(Régis Hanol) #3

I cannot reproduce this issue on http://try.discourse.org. Are you using plugins or custom code?


(Maestro Magnifico) #4

Didn’t knew about them. :slight_smile: I will reproduce this later today (have to go work now) and will post errors in logs.

I’m not using any custom code, except some javascript. And here’s my plugins:

      - git clone https://github.com/discourse/docker_manager.git
      - git clone https://github.com/defaye/discourse-steam-login.git
      - git clone https://github.com/discourse/discourse-spoiler-alert
      - git clone https://github.com/discourse/discourse-details
      - git clone https://github.com/Yachtsman/discourse-vk-login.git
      - git clone https://github.com/discourse/discourse-bbcode-color/
      - git clone https://github.com/discourse/discourse-tagging

(Maestro Magnifico) #5

Tried to repro this yesterday and couldn’t. Don’t close topic yet please, I’ll bump it when this will happen again and will post logs and errors from console.


(Wes Osborn) #6

I was having something similar happen, including on try.discourse.org, but then I opened my browser in an incognito window and I wasn’t having the issue anymore. My guess is that the problem could have been coming from my adblocker, but I didn’t have enough time to narrow it down.

Are you running an browser plugins/extension?


(Kane York) #7

This is happening on Meta, but isn’t there another topic open about it?


(Maestro Magnifico) #8

Rly? Didn’t saw it.

I am running AdBlock Plus.


(Tarak'ha) #9

This has happened to me in the past few days here on Meta. I tend to be a chronic ninja editor within the 5 minute window.

As @Maestra_Powers described: you write your edits, you hit Save Edit and for a split second it looks like your changes were made but once the composer drawer drops and things are loaded in, it doesn’t save.

Sometimes when I quickly re-edit my original edits are back in the drawer and I hit Save Edit again to which it finally sticks. Other times I’m not so lucky.

And yes, this happens either as a ninja-edit or an edit past the 5 minute window. This error doesn’t happen all the time. I could say in the past few days this may have happened at least twice that I can remember (out of many, many edits. like right now this is my third ninja-edit I am writing right now.)

Fourth ninja-edit! Yes, I have an ad-blocker on my Chrome here.


Indication of whether a post actually has saved
(Kane York) #10

My ad blocker is turned off on Meta, so it isn’t that.


(Tarak'ha) #11

It just happened to me right [here][1]. And it wasn’t even for an edit but instead to make a reply. I saw that there was some kind of struggle going on to catch up with the draft auto-saving itself.

When I made my reply I noticed it used the auto-save cache of an earlier version of my reply. That’s why my ninja edit didn’t make the window. I had to re-write half my post.

I think I know why this is happening, at least for me. [Chrome is shitting the bed with its cache.][2] I don’t know if it might be related but it’s been making my Chrome ux painful.

To a point that after I saw that report linked above I went over back to here and made that reply also linked above. Things were starting to lurch again especially when the composer drawer was saving the draft. I tried to copy my post. I then hit ‘reply’. Sure enough, as I stated, it reverted to the post’s earlier draft while I was typing it out.

It may or may-not be the reason.
[1]: Marking *all* new topics as new?
[2]: 336734 - page load hangs with "Waiting for cache..." message - chromium - Monorail


It JUST happened again! Above is what was posted. Here is the actual post as I again copy and pasted it, this time into a txt file:

It just happened to me right [here][1].

When I made my ninja-edit to add a screenshot and other things I noticed it used the auto-save cache of an earlier version of my ninja-edit. That’s why my ninja edit didn’t make the 5 minute window. I thought I had to re-write half my post.

I think I know why this is happening, at least for me. [Chrome is shitting the bed with its cache.][2] I don’t know if it might be related but it’s been making my Chrome ux painful.

To a point that after I saw that report linked above I went over back to here and made that reply also linked above. Things were starting to lurch again especially when the composer drawer was auto-saving the draft of my ninja-edit. I tried to copy my post because I had that ‘uh-oh spaghettios’ gut feeling that it was going to happen because of the cache.

I then hit Save Edit’. Sure enough, as I stated, when the drawer left and the cooked post was up it showed the ninja-edit’s earlier auto-save draft while I was typing it out.

This is in relation to how some of us think it is saved but the final cooked post either doesn’t have the edits at all or it shows an early draft of that edit. There’s a disconnect between the actual content we see (the cooked final version) and what is actually there (ie, in the database).

I know this because when the cooked post came up after my ninja edit it showed a very serious copy/paste error where my carat was incorrectly positioned in Jeff’s quote. I pasted my screenshot in and it went right into the quote of his previous reply. I obviously fixed it and went on with the rest of my ninja-edit. I saved it and the cooked post showed an incomplete reply and that very grave error. I tried copying and pasting my saved post but it all fumbled somehow. I had to re-write half of it, fix the img-paste error, ect. That’s why I didn’t make the 5 minute ninja edit window this time with this second edit.

This Chrome situation with its cache may or may-not be the reason. At least it’s an idea.
[1]: Marking *all* new topics as new?
[2]: 336734 - page load hangs with “Waiting for cache...” message - chromium - Monorail


Indication of whether a post actually has saved
Indication of whether a post actually has saved
(Régis Hanol) #12

This sounds painful… :unamused: I know it’s hard but I would love to have a repro so that we could fix it once and for all.


(Tarak'ha) #13

It is difficult because it’s intermittent. I notice it has to do with the draft auto-saving. Possibly when my edits/replies take longer and the text is longer, ect. At least under five minutes for the ninja-edits so I can make that free edit window.

I am not doing anything out of the ordinary as far as clicking things. That’s what makes this difficult to repro.

I went ahead and disabled my cache. I also cleared it. At least the actual media cache and not my cookies or history. But something tells me I will have to clear those too.

My case is more pronounced because I am on an extra laptop right now. I usually surf Discourse from my power-awesome workstation, which is currently out of service as I’ve temporarily cannibalized some of its parts to setup a rig I just finished building to be my home web dev server (for Discourse, among other things). I haven’t emptied this laptop’s temp Chrome files from it for a while. Not only has this happened on the laptop but also Jeff’s Nexus. Same thing. Ux on the Nexus has deteriorated recently. I truly believe it has to do with Chrome’s cache.

I will say that this has happened even on my workstation. But only a few times in the span of weeks or a month or two at a time. All these recent instances happened within days, hours and as you’ve seen, right after the other. Possibly because my laptop strained the original problem Chrome has to extraordinary levels. Same with the Nexus.

I’ll see what happens in the meantime now that I’ve taken steps into some kind of solution. At least for myself.


Indication of whether a post actually has saved
Indication of whether a post actually has saved
(Maestro Magnifico) #14

It just happened again on my forum. Browser console log is empty, and here’s errors from Discourse /logs (top to bottom):

  1. http://forum.discourse.su/logs/show/cbbad51951d0ba430fd94b63df74f7dc
  2. http://forum.discourse.su/logs/show/9a54d7fb97454823122fd853f3e89470
  3. http://forum.discourse.su/logs/show/822449755be2f2201e19531389a988dd
  4. http://forum.discourse.su/logs/show/36703a9cff12ad814e7fa69fb0819c0b

And a screenshot just in case:

It happened not in ninja-editing window, but right after. Post was marked as edited (i didn’t refreshed this page yet):


ADD: Now I opened history of changes and both left and right versions of post are the same.


(Jeff Atwood) #15

We just need consistent repro steps.


(Maestro Magnifico) #16

It just happened here again: Discourse Russian community
You can see that 2 and 3 versions of post are the same. For now I can’t give more consistent steps than in first post. All I can add is that this happens right after ninja-edit window, at least for me. I will try to make more editing after pressing F5 and will see how it goes. My guess is - if you started to edit post before ninja-editing times up and pressed Save Edit after, post will not save. This issue needs more testy test.

Not confirmed. I started to edit this post on 1m, saved on 6m and it saved. :expressionless: Come on guys, we can figure out how to break Discourse editing 10 out of 10 times, I believe in us.


(Tarak'ha) #17

Checking in to say I haven’t had a single problem since disabling and emptying my Chrome’s cache. I don’t get the same ‘stutter’, even with the composer.

Fingers crossed for this.


(Matthieu) #18

For us it happened about every time we edit a wiki-post and often when editing a normal topic.

  • you edit, you save
  • it loads the new content
  • it reload the old content
  • click again on edit
  • it opens the saved draft
  • save again
  • now it works

Why ? I do not know, there is nothing special in the logs.


(Sam Saffron) #19

Can you repro on try ?


(cpradio) #20

I had this happen on Sitepoint yesterday too. I couldn’t repro it at will though and for a moment though I was losing my mind till I clicked Edit and actually saw my edited message in the composer window.