• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 deferred.php hanging

MattW

Well-known member
#1
I've been trying to help get to the bottom of a double posting issue, and we've been able to reproduce it. It's happening when deferred.php is being called, and it's causing the browser to lock, and just display the loading icon in the top right. People are then posting again, causing a double post. If you refresh the page, the post has been submitted, and also a draft copy saved in the editor.

I've removed all the code from the templates (public and admin) to trigger deferred.php, and run it from a cron. I'm still seeing it being called though when posting messages:
Code:
MYIP - - [29/Jun/2016:00:01:52 -0400] "POST /talk/threads/new-test-thread.155136/add-reply HTTP/1.1" 200 2494 "http://www.hearth.com/talk/threads/new-test-thread.155136/page-2" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Ge
cko/20100101 Firefox/47.0"
 MYIP - - [29/Jun/2016:00:01:53 -0400] "POST /talk/deferred.php HTTP/1.1" 200 22 "http://www.hearth.com/talk/threads/new-test-thread.155136/page-2" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"
What else could be calling deferred.php, and is there any way to try and figure why it's stalling in the browser?

The server itself isn't running into any resource issues, load is always below 1, and PHP has enough time allocated to run (300 seconds), along with a high enough memory limit.
 

Mike

XenForo developer
Staff member
#2
Deferred.php is loaded from the JS automatically when needed. In this case, it probably indicates that there were entries added to the mail queue that need to be sent.

The trigger is after the response from the server is returned, so you'll want to look into JS errors that are happening in this case I think. The deferred calls won't create any sort of Ajax loading indication.
 

MattW

Well-known member
#3
Can't seem to really find anything, and it's still happening

upload_2016-6-29_17-50-48.png

upload_2016-6-29_17-54-15.png

I'm not sure if his is ad related or not (amazon)??
 

Chris D

XenForo developer
Staff member
#6
It's to do with the responsive ad code I think.

It's trying to calculate the width of the post before it is visible hence its getting a width of 0.

Really not a lot I can suggest to fix it other than wrapping the JS in a conditional so it bails out gracefully if it detects a 0 width.
 

MattW

Well-known member
#7
Thanks Chris and Mike. I've passed the info to Jim, and he might need to raise the issue with Themehouse, as he's using their monetize pro addon to serve the ads.
 

Jake B.

Well-known member
#8
Looking into this it seems to come up when the post is rendered via javascript on the quick reply. Is there any variable available in the template to determine if the post is coming from actionShowNewPosts after a quick reply?