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

XF 1.4 Multiple "new posts" alert between visits

Mouth

Well-known member
#1
I'm getting a couple of users saying they are getting multiple "new posts" alerts, between their visits. For example ...



How can I diagnose this further?
 

Mouth

Well-known member
#3
Appreciate the assistance.

It is installed, but has been disabled for over a month.
Also, the thread you linked to is over 2 years old and, following it's link to Tapatalk, the issue it references was fixed by them over 2 years ago too.

Thanks.
 

Xon

Well-known member
#4
Alerts will always be sent if ~15 ignored posts occur before the reply, as XF gives up trying to find a post the user hasn't seen.
 

Mouth

Well-known member
#6
A single alert will be sent until the thread has been viewed.
Yes, that was my understanding. Put as per my screenshot above, you can see the user is getting multiple notifications for the "Dumb Ass Questions" thread. The user was not logged on during that day yet, and got all those alerts at once when they logged in several hours later.
 

Xon

Well-known member
#7
A single alert will be sent until the thread has been viewed.
That may be the intention, but the implementation will send alerts if there are enough ignored posts before the just posted reply.

XenForo_Model_ThreadWatch::sendNotificationToWatchUsersOnReply fetches the last 15 posts, and then checks to see if the previous posts are ignored in an attempt to determine the a post_date to compare to the user's thread read date.

Code:
            if (!$defaultPreviousPost || !$userModel->isUserIgnored($user, $defaultPreviousPost['user_id']))
            {
                $previousPost = $defaultPreviousPost;
            }
            else
            {
                // need to recalculate the last post that they would've seen
                $previousPost = false;
                foreach ($latestPosts AS $latestPost)
                {
                    if (!$userModel->isUserIgnored($user, $latestPost['user_id']))
                    {
                        // this is the most recent post they didn't ignore
                        $previousPost = $latestPost;
                        break;
                    }
                }
            }

            if (!$previousPost || $previousPost['post_date'] < $autoReadDate)
            {
                // always alert
            }
            else if ($previousPost['post_date'] > $user['thread_read_date'])
            {
                // user hasn't read the thread since the last alert, don't send another one
                continue;
            }
 
Last edited:

Mike

XenForo developer
Staff member
#8
It's probably unlikely to be that, because a single post by a non-ignored person will prevent it (and you wouldn't get an alert by someone you ignore).

It's more than likely related to an add-on though. Every time something like this has come up, it's been eventually tracked back to an add-on.
 

Xon

Well-known member
#9
It's probably unlikely to be that, because a single post by a non-ignored person will prevent it (and you wouldn't get an alert by someone you ignore).
I had someone with +800 ignored users on their ignore list, another person with +600, and another 3 with +200 ignored users.

And the person with +800 ignored users; added about 200 from September to November and another 100 for December.

:cry:

It's more than likely related to an add-on though. Every time something like this has come up, it's been eventually tracked back to an add-on.
Very likely.
 
Last edited: