Unread notifications disappearing after 7 days

Bug Reports
  • Hi,

    we've got an issue with our older, but still unread notifications. They are disappearing after 7 days without being read. I know that read notifications are supposed to disappear after that time. But I guess it's not supposed to happen for unread ones.

    I've got one user who's got 50+ notifications after being on holiday for little over a week. I've been checking on his notifications and one after another they disappeared after turning older than 7 days. One time checking I saw two notifications that read "8 days ago". But now those are gone as well and the oldest ones all read "7 days ago".

    Is this a known issue? And is there any way to retrieve those notifications? We're currently running NodeBB v1.11.1, I haven't gotten around upgrading to v1.11.2 yet.

    Thanks,
    Alex

  • Hi @AlexG this is intentional, actually, but I wasn't sure why so I took a little dive into the commit history.

    It was added here: https://github.com/NodeBB/NodeBB/commit/26d9cc56d30c6a0a3c75cd427f04c71a67fb592a 5 (!!) years ago, the reason being that I wanted to limit database clutter.

    You see, notifications are created and purposely aren't cleaned up immediately, as read notifications still have some utility. Additionally, when a notification is created, it can be pushed to multiple users, so even if it is read by one recipient, it could be unread for many other users.

    Additionally, some users are inactive and may never read a notification, so would that notification linger around the database forever?

    I'm not a fan of database bloat, and notifications had the potential to really litter the database. Therefore, after a week, notifications are removed, both read and unread.

    The logic really hasn't changed at all since it was initially added. We can opt to make this configurable, with different limits on read notifications and unread notifications, but I firmly believe notification pruning is necessary.

  • Hi @julian

    thanks for your quick reply. It's really helpful for me to know that it is like that. And I completely understand why it was implemented. It seems I must have read some info wrong or it must have been old.

    But that's actually quite a major issue for us and they way we're using NodeBB. It would be great if notification deletion could be made configurable. How are the chances of that beeing implemented? I don't know how much of an issue that is for other users of NodeBB.

    Though I still need a short term solution for that. I need a way for a user to find all of his mentions when he hasn't been looged on for more than 7 days (but usually not more than a couple of weeks). Utilizing search won't really work, because it's not just about personal mentions, but also all of the groups the user is in. So that way would be rather inconvenient. The only possibility for me right now seems to be using email notifications. But maybe you've got another idea.

    Thanks again for your help,
    Alex

  • @julian is this approach also used to track read/unread posts (not only notifications)? We've experienced both on our nodeBB instance, as well as here, that the unread category only presents posts/thread that are no more that 1 week old.

    Is it safe to change -7 in something more reasonable to us?

    cutoff = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 7);
    

    This is a must have here at Maxon.

    Cheers, R

  • @knickknack Yes, most likely we went with something like that as well for unread posts.

    You'll have to ask @baris for this thoughts -- he has more familiarity with that part of the codebase 😄

  • You should be able to configure the unread cutoff in the ACP, https://github.com/NodeBB/NodeBB/blob/master/src/topics/unread.js#L50


Suggested Topics


  • 0 Votes
    6 Posts
    3k Views

    @julian
    good to know this useful information, I checked on mine (not changed any redis db config when installed nodebb) so in doubt I checked, here the log file, sounds to works fine and default are

    save 900 1 save 300 10 save 60 10000

    and logs

    [574] 17 Sep 20:02:36.228 * Background saving terminated with success [574] 17 Sep 20:07:37.008 * 10 changes in 300 seconds. Saving... [574] 17 Sep 20:07:37.009 * Background saving started by pid 16535 [16535] 17 Sep 20:07:37.196 * DB saved on disk [16535] 17 Sep 20:07:37.197 * RDB: 0 MB of memory used by copy-on-write [574] 17 Sep 20:07:37.210 * Background saving terminated with success [574] 17 Sep 20:12:38.037 * 10 changes in 300 seconds. Saving... [574] 17 Sep 20:12:38.039 * Background saving started by pid 16538 [16538] 17 Sep 20:12:38.227 * DB saved on disk [16538] 17 Sep 20:12:38.228 * RDB: 1 MB of memory used by copy-on-write [574] 17 Sep 20:12:38.239 * Background saving terminated with success [574] 17 Sep 20:17:39.093 * 10 changes in 300 seconds. Saving... [574] 17 Sep 20:17:39.094 * Background saving started by pid 16543 [16543] 17 Sep 20:17:39.308 * DB saved on disk [16543] 17 Sep 20:17:39.310 * RDB: 0 MB of memory used by copy-on-write [574] 17 Sep 20:17:39.395 * Background saving terminated with success [574] 17 Sep 20:22:40.096 * 10 changes in 300 seconds. Saving... [574] 17 Sep 20:22:40.097 * Background saving started by pid 16550 [16550] 17 Sep 20:22:40.276 * DB saved on disk [16550] 17 Sep 20:22:40.277 * RDB: 0 MB of memory used by copy-on-write [574] 17 Sep 20:22:40.298 * Background saving terminated with success
  • 0 Votes
    1 Posts
    922 Views

    I haven't logged in for a while, but when I did I found a notification waiting. But when I click on the notification area, it kind of flashes and says there are no notifications:

    notifications.PNG

    It kind of seems like it's finding a notification for me and then possibly realizing it's old and removing it when I try to view it.

  • Unread count inconsistent

    Bug Reports
    0 Votes
    9 Posts
    2k Views

    @psychobunny, so long as you don't take a similar approach with Feature Requests 😉

  • Category disappeared

    Bug Reports
    0 Votes
    9 Posts
    3k Views

    @julian Ahh, yes! I deactivated it and magic!

    Pro-tip to future self: Don't "install all the things" when you first deploy something new. Thanks, Julian.

  • Notifications & new posts

    Bug Reports
    0 Votes
    5 Posts
    2k Views

    "They" (flex)