Lack of interest "Cannot insert a message in the middle of a discussion" on busy thread, with slow event hooks

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

thedude

Well-known member
We have some custom code that gets called before XenForo_ControllerPublic_Thread::actionAddReply and can sometimes cause a delay of a couple of seconds before the real actionAddReply gets called. On a busy thread, posts by other users are often created during this couple second delay, resulting in the "Cannot insert a message" error.

I'd like to suggest having XenForo_DataWriter_DiscussionMessage use the current time() instead of XenForo_Application::$time for the post_date field since, from a cursory check, it appears this would have no negative side effects and from our testing alleviates the "Cannot insert a message" issue during this check:
Code:
if ($this->get('post_date') < $discussionDw->get('last_post_date'))

It may also help with situations where native functions might cause a delay before actionAddReply gets called, as well.
 
Last edited:
Upvote 1
This suggestion has been closed. Votes are no longer accepted.
Top