XF 2.1 Actions that appeared "Live" without needing to refresh no longer occur, like User Alerts

Details:
  • XF 2.1.3
  • PHP 7.3
  • PHP Handler lsapi
I've come to notice that certain functionality is no longer working since updating to 2.1.3. Included is anything that usually happens "live" (AJAX i guess) without a refresh of the page. That would be User Alerts, Private Conversation Alerts, the notice that appears at the bottom of a thread when new messages have been posted in a thread asking you to click to load them, etc.
 
We haven't made any changes to these things and those things are working fine here, so there may be more to it.

You may need to check in your browser console to see if there are any errors logged.
 
@Chris D, can you give me any technical information I can pass on to my hosting provider in regards to the technology that makes these "live alerts" possible? Is it AJAX, some kind of Javascript framework, etc.?

I just had them update me to PHP 7.3 (from 7.0) and they moved me from the PHP Handler suphp (or mod_something) to the newer 'lsapi' that they said is way more efficient. Those are the only two things that changed on my side.

Anything I discover I'll pass back your way!

Otherwise, the only thing I've done is patch the editor-compiled.js as was mentioned in this resolved bug thread: https://xenforo.com/community/threa...-editor-automatically-after-inserting.167631/
 
It’s essentially just plain JavaScript.

You can reproduce the issues you’re reporting at will. The easiest one involves two browsers and a single thread.

Go to the same thread in both browsers, go to the last page if applicable. Have the browser console open in the second browser as this is where JavaScript errors are logged.

Write a reply in the first browser and post it.

In the second browser start writing a new reply, but don’t post it and then wait for up to 60 seconds for the draft system to automatically save or click the “Save draft” button.

This is what triggers the “new messages have been posted banner” (because you have written a post in the first browser).

Check in the browser console for any errors.
 
@Chris D,
Thank you for this tip. I tried this last night and didn't realize that I needed to wait for the draft to save. This portion is working correctly.

What I can't seem to get working is giving myself a like or a conversation in a 2nd browser and account. Previously, I was pretty sure that the alerts would appear without the need to browse to a new page or press 'refresh.' Is this correct or am I imagining things?
 
@Chris D

Ha, well as if by accident I moments ago upgraded also and am noticing that Alerts are no longer triggering as consistently. It hasn't been too long so nothing scientific.

Usecase: regular user (registered), tags admin user (admin group only) in reply to an existing thread. Expect a mention alert but get nothing.

Conversations do trigger the new PC alert.

New thread with a mention DO trigger alert so seems to be replies at the moment.

Did some for alert dispatch criteria change with 2.1.3?

No browser errors or server errors.

EDIT: Appears to be intermittent which would be one's favourite type of problem.
 
Last edited:
Nothing has changed in this area, even dating back to XF 1.5.

Just to be clear about how it works, the alerts count only updates if some other AJAX action occurs. Whenever an AJAX action occurs we get the up to date counts and display them.

There is nothing that polls the server periodically or forces it to update when an event happens.

There were many add-ons for XF1 which did a live update/automatic polling to update the counts. But that’s not something we’ve done ourselves.
 
Back
Top Bottom