Phuks-co / throat

Open Source link aggregator and discussion platform powering Phuks
https://phuks.co
MIT License
73 stars 32 forks source link

While marking notifications read, delete ones over a month old #451

Closed happy-river closed 2 years ago

happy-river commented 2 years ago

We are currently averaging 1500 new notifications created per day, and 10 requests to /notifications/delete per week (the "delete notification" link on the notifications page). We have a route for paginated notifications (/notifications/xxx) but get zero requests for it, because there are no pagination buttons on the first notification page. In the past year, it has also not occurred to any of our users to ask for pagination buttons on that page.

All of this has lead to a giant backlog of notifications in our database that no one cares about or is ever going to look at. Start pruning the backlog by deleting old notifications when marking notifications read, defining old as both older than a month and not in the newest 50 for that user.