View Issue Details

IDProjectCategoryView StatusLast Update
0017841phplist applicationOtherpublic23-09-15 14:59
Reporterduncanc 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.2.0 
Target Versionnext patchFixed in Version3.2.1 
Summary0017841: Keep-alive requests are being sent too often
DescriptionI'm seeing unexpected results in the Firefox web console when a tab of the Send Message page is open.

Initially there is a keep-alive request sent but there are also two other requests. One for jquery and a second for phplistapp.js. See the attached screenshot for an example. Is there a reason for those two files being requested?

Further, leaving the tab open the frequency of the requests increases. The screenshot shows the requests being sent three times within 2 seconds. After a few minutes the requests seem to be sent several times, then a gap of about one minute, then the requests sent several times again.

TagsNo tags attached.

Activities

duncanc

22-09-15 12:02

developer  

Screenshot_keepalive.png (51,110 bytes)
Screenshot_keepalive.png (51,110 bytes)

michiel

22-09-15 12:05

manager   ~0056880


ah, I thought I had increased that time quite a lot. Maybe it didn't propagate.

This will be good to fix quickly, as it will cause browser issues.

michiel

22-09-15 14:26

manager   ~0056882

ah, yes, the reason for the js files to be included is 0016924

I couldn't figure out why I wasn't able to do jQuery calls in the snippet that is fetched with an Ajax call. It only worked when I included jQuery again in the snippet. That's rather annoying. Do you have a way to do that? Maybe something like "top.jQuery"?

duncanc

23-09-15 06:21

developer   ~0056886

I'm not sure that I understand fully how the javascript is meant to work but I also saw messages in the Firefox console about "too much recursion", which may indicate a problem in the way that this is trying to work.

I found an alternative using the setInterval() function, which creates a repeating event.

This now seems to work for me

use setInterval instead of setTimeout in phplistapp.js and change autosave() to

function autoSave() {
  // in the future, do an auto-save, for now, we want to keep the session alive
  $.get('./?page=pageaction&ajaxed=true&action=keepalive');
}
Now keepalive.php doesn't need to return anything specific

$status = '';

See the second screenshot where the keepalive is being repeated every 30s with no explosion of requests. Also, the js files are now not requested.

duncanc

23-09-15 06:22

developer  

keepalive changed.png (19,398 bytes)
keepalive changed.png (19,398 bytes)

michiel

23-09-15 14:59

manager   ~0056887

https://github.com/phpList/phplist3/commit/d6aba6cb25395b0438b5c729bf687695d9f00e97