Fixed Thread/Post drafts cause multiple html => bbcode conversion

Xon

Well-known member
Affected version
2.1.4
When saving a draft for a new thread/post, the message html is decoded into bbcode twice. For longer posts, this can cause unexpected (and avoidable) delays in draft handling

Once when the setupThreadCreate or setupThreadReply is called in actionPreview/actionReplyPreview and then in actionDraftMessage::updateMessageDraft
 
Given that the call to save the draft and the call to show the preview are separate HTTP requests that would share no state or data, short of creating some sort of stateless cache like writing the result of fromInput() into memcache or something similar, this seems like it's just one of those things.

That said, we have an entirely new approach coming soon that will make this moot.
 
My work-around was to just cache the decoded output for when those actions are called since I've got some add-ons which make it worse (3-4 calls, which for drafts when people have +50k character posts is kinda yuck)
 
Top Bottom