Implemented Prune Unread Alerts

digitalpoint

Well-known member
It would be useful to have an option to prune unread alerts after a certain amount of time.

Just noticed that I have some users with over 10,000 unread alerts because they are watching some very active forums, but they haven't visited the forum in over a year (their watched forum settings were imported from vB in case you are wondering how they are watching a forum for longer than the feature has been there).

I have hundreds of users with over 1,000 unread alerts due to the same issue.

How useful is an alert really to the user when the alert is from 6 months prior? And for scaling purposes, when you have someone getting alerts for every thread (or in some cases every post) in a forum for years and years when they don't visit the site any longer is going to end up with a lot of records in your database if you use XenForo for like 100 years or so.
 
Upvote 1
This suggestion has been implemented. Votes are no longer accepted.
It should be doing that already:
Code:
        XenForo_Model::create('XenForo_Model_Alert')->deleteOldReadAlerts();
        XenForo_Model::create('XenForo_Model_Alert')->deleteOldUnreadAlerts();
The former deletes them a certain amount of time after you've viewed them, the latter deletes them 30 days after they were sent (if you haven't viewed them).

Are you looking at the alert count in the user table or the actual alerts? (We don't update the count when pruning unread alerts.)
 
It should be doing that already:
Code:
        XenForo_Model::create('XenForo_Model_Alert')->deleteOldReadAlerts();
        XenForo_Model::create('XenForo_Model_Alert')->deleteOldUnreadAlerts();
The former deletes them a certain amount of time after you've viewed them, the latter deletes them 30 days after they were sent (if you haven't viewed them).

Are you looking at the alert count in the user table or the actual alerts? (We don't update the count when pruning unread alerts.)
Is there a way to change the number of days? Or at the very least tie it to the "Read Marking Data Lifetime (Days)" option. Which now that I think about it, that would make sense as it's sort of pointless to keep an alert for a thread that's already marked read (even if you haven't actually viewed it).
 
It should be doing that already:
Code:
        XenForo_Model::create('XenForo_Model_Alert')->deleteOldReadAlerts();
        XenForo_Model::create('XenForo_Model_Alert')->deleteOldUnreadAlerts();
The former deletes them a certain amount of time after you've viewed them, the latter deletes them 30 days after they were sent (if you haven't viewed them).

Are you looking at the alert count in the user table or the actual alerts? (We don't update the count when pruning unread alerts.)
Okay yeah... ignore this suggestion. :) Just checked the guy with 10,000+ alerts on his counter... there's only 2,488 in the alert table... the oldest from 30 days ago. So it's working as designed. :)
 
Top Bottom