Edit of rebaked post doesn't show in HTML; only in raw

(Dan Dascalescu) #1

I’ve just run into a very odd issue. I’ve edited this post as an admin, and after saving, none of my changes show up in the HTML!

The HTML diff doesn’t show any difference. The markdown/raw diff correctly shows the changes (as does the raw post), but they aren’t rendered in the post itself. Needless to say, I’ve reloaded the page a bunch of times, but Discourse still shows the previous revision (#2) of the post, which was created by the rebake task - maybe this is the culprit?

(Régis Hanol) #2

This is very odd indeed. Are there anything in /logs regarding this post? Does it fix it when you “Rebuild the html”?

(Sam Saffron) #3

I still kind of feel cooked post processor should rebake raw, there are weird timing issues with edit

(Régis Hanol) #4

Yup, I agree. I have it on today’s TODO list to test and make sure it doesn’t break anything.

(Jeff Atwood) #5

Yeah we’ve definitely seen weird issues here with editing and having to rebake. If you can nail down a consistent repro that’d be awesome.

(Sam Saffron) #6

I know exactly how this happens:

“cooked post processor” is our process that downloads images from posts, runs slow oneboxes and so on. It only looks at “cooked HTML”

  1. In one process… cooked post processor is running (in sidekiq) this takes a while to run
  2. In another process an edit happens, this produces new “cooked”
  3. The process (1) finishes and overwrites “cooked” produced in (2)
  4. Edit process kicks off “cooked post processor” it uses “cooked” produced by step (3)

End result is that edit happens but cooked is not updated.

The correct solution here is to make sure that cooked post processor always rebakes markdown.

(Jeff Atwood) #7

Awesome, this weird little bug has been a thorn in our side for a while. Love to see it fixed!

(Régis Hanol) #8

Here’s the fix :tada:


(Régis Hanol) #9