At some point in the last 16, or so, hours a change was made to the data returned from the Stack Exchange internal /posts/ajax-load-realtime/{list of semicolon separated postIDs}
endpoint. The response changed from plain HTML text to a JSON encoded Object with at least two properties: Html
and VotesCastJson
. Unfortunately, when this change was made, SE's codebase wasn't searched for every place where this endpoint was used and/or those places were not actually changed.
I haven't done an exhaustive check to see everywhere which this change breaks things (e.g. there may additional things which relied upon the internal HTML structure provided). In addition, there have been reports of other issues in other areas of the site which could easily be related to this or similar endpoint changes. However, one place where this endpoint is used is StackExchange.realtime.reloadPosts([array of post IDs])
. The code for that function assumes that it's still going to receive straight HTML text, rather than a JSON encoded Object with the HTML text in the Html
property. This, of course, breaks everything which relies on StackExchange.realtime.reloadPosts()
.
You can test to see if this is working by opening up the browser console for this question, or any question, and typing StackExchange.realtime.reloadPosts([$('.question').data('questionid')])
, which should reload the HTML for this question. At the time of posting this question, instead of the correct operation it will produce a Syntax Error.
Note: the new VotesCastJson
property appears to be intended to reduce the need to call the /posts/${postId}/votes
endpoint to get the votes for the post that's being reloaded, but the data returned in that property is invalid in all cases which I've checked.
StackExchange.realtime.expandAnswers()
was updated to use the new response format from theajax-load-realtime
endpoint, whereas.reloadPosts()
was not.