[AddonsLab] Unread Post Count

[AddonsLab] Unread Post Count 1.6.0

No permission to download

AddonsLab

Well-known member
AddonsLab submitted a new resource:

[AddonsLab] Unread Post Count - The add-on shows the number of unread posts on What's New tab

The add-on shows the number of unread posts on What's New tab. This is the migration of XenForo 1.x add-on "Unread Post Count" by @Chris D and includes all its features. The option to configure the cache timeout is in "Threads, discussions and conversations" options group, as before.

As XenForo 2.x has introduced a new Navigation engine, we have created another add-on - "[AddonsLab] Navigation...

Read more about this resource...
 
XF 2.X RC 2
Not sure if I have hit a bug.
Set the cache time to 5 min
Then marked all forums read
The count still stays. Doesn't matter even if i change to 1 min or 0, or even uninstall and reinstall. The old numbers still persist ... check the post below.
Rebuilding User cache fixes the issue, but there's some issue if user Marks the forum as read and doesn't go thru each post clicking it.
 
Last edited:
And, on disabling the add on, site becomes non accessible. 2.0.0 RC2

An exception occurred: [Error] Call to undefined method XF\Repository\Post::unreadCacheShouldUpdate() in src/addons/AL/UnreadPostCount/Callback.php on line 24

  1. AL\UnreadPostCount\Callback::getUnreadPostCount()

  2. call_user_func() in src/addons/AL/NavigationBadge/Listener/NavigationSetup.php at line 49

  3. AL\NavigationBadge\Listener\NavigationSetup::listen()

  4. call_user_func_array() in src/XF/Extension.php at line 67

  5. XF\Extension->fire() in src/XF/App.php at line 2324

  6. XF\App->fire() in src/XF/Pub/App.php at line 474

  7. XF\Pub\App->getNavigation() in src/XF/Pub/App.php at line 415

  8. XF\Pub\App->renderPageHtml() in src/XF/App.php at line 1698

  9. XF\App->renderPage() in src/XF/Mvc/Dispatcher.php at line 310

  10. XF\Mvc\Dispatcher->render() in src/XF/Mvc/Dispatcher.php at line 44

  11. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1863

  12. XF\App->run() in src/XF.php at line 328

  13. XF::runApp() in index.php at line 13


On uninstalling and reinstalling the add on, the old unread count comes back. So, loos like uninstalling is not removing the old data that it created. All posts are read (Via Mark Read) but the count shows 327 still
 
Hello, @sip

We will check the case with marking forums as read and update here.

It seems you have disabled the Unread Post Count add-on, but left Navigation Badge enabled and What's New button is still configured to show the unread post count. We will update the Navigation Badge add-on and make sure it does not break when the callback is not available anymore. Meanwhiles, please disable the badge for What's New button, that will solve the issue.

Post count cache is stored in user session for each user, so removing this data on uninstallation is technically challenging. The add-on caches the data only for some time (configured). If this time is too long for your case, just decrease it in Admin Panel. Setting it to 0 will disable the cache. This is helpful to troubleshoot the issue and understand, is it because the cache or the product actually counts the number of posts wrongly.

The fixes will be released here soon.

Thank you!
 
If I disable cache, it counts fine.
The configured value for cache doesn't get respected if we hit "Mark All forums read"
After enabling cache, even setting value to 0 doesn't clear it. Only way to clear is to rebuild user cache.
Currently running what's new with cache disabled.
 
If I disable cache, it counts fine.
The configured value for cache doesn't get respected if we hit "Mark All forums read"
After enabling cache, even setting value to 0 doesn't clear it. Only way to clear is to rebuild user cache.
Currently running what's new with cache disabled.

Thank you for the reply. We are working on this, the fix will be released in coming hours.

Thank you!
 
  • Like
Reactions: sip
AddonsLab updated [AddonsLab] Unread Post Count with a new update entry:

Stability fixes and other improvements

Hello everyone,

In this version we have implemented several stability fixes, that prevent a PHP error in case the Navigation Badge add-on is configured to show the number of unread posts, but this add-on is de-activated. Now the number of unread posts will continue being shown without any issues unless you disable the badge from Navigation Badge addon.

The bug of not updating unread post count when forums are marked as read is now fixed.

We have also implemented a new option right under...

Read the rest of this update entry...
 
No, Navigation Badge add-on did not require any changes.
Ok upgraded. Liked the badge disappearing on count 0.
Cache part under testing. So will update if there's any anomaly.
If I set cache to 3 min. This means that count will update only after every 3 minutes?

What would be the performance hit iif cache is disabled?
 
Ok upgraded. Liked the badge disappearing on count 0.
Cache part under testing. So will update if there's any anomaly.
If I set cache to 3 min. This means that count will update only after every 3 minutes?

What would be the performance hit iif cache is disabled?

Yes, the count disappears as that is the new default option. You can disable it and you will see 0 as well. Yes, cache will update in 3 minutes in that case. With disabled cache it will execute 2 additional queries on each page load. The resulting performance hit will depend on your server load, the number of users navigating the website etc.

Thank you!
 
  • Like
Reactions: sip
Sorry cache mode doesn't work
Enabled cache to 3 min
New posts were created and even after half an hoyur nothing showed up on the counter. Rebuild user cache multiple times no impact.
Disabled cache, rebuild user cache and Counts shows up fine. So running w/o cache now.
 
Sorry cache mode doesn't work
Enabled cache to 3 min
New posts were created and even after half an hoyur nothing showed up on the counter. Rebuild user cache multiple times no impact.
Disabled cache, rebuild user cache and Counts shows up fine. So running w/o cache now.

Thank you for the report. We will check this asap and update here.

Thank you!
 
A Quick question (sorry for too many)
In Cache Mode:

If a user clicks an unread post the count would update immediately?
For the cache duration (say three minutes) if any new post comes in then that New count will only show on next cache update?

Is this the way it is designed to work?
 
A Quick question (sorry for too many)
In Cache Mode:

If a user clicks an unread post the count would update immediately?
For the cache duration (say three minutes) if any new post comes in then that New count will only show on next cache update?

Is this the way it is designed to work?

Yes, when viewing a thread, it is marked as viewed, and the unread post count decreases appropriately. Exactly, when there is a new post during the cache time, the count will update in 3 minutes.

Just let us know if you have more questions.

Thank you!
 
  • Like
Reactions: sip
This implementation takes into account the message from private forums. Because the user cannot read private forum, he always have unread messages.
Hmm. No wonder few complained that they are seeing Unread Messages althout they have read everything.
Could this be the reason? f yes, then this needs to be fixed.
 
Top Bottom