Notifications stuck on non-existing users due to follow plugin

AI-generated summary

The discussion revolves around an issue with notifications stuck on non-existing users. bartv reports that users are receiving the same notifications multiple times due to Sidekiq retrying notifications for a non-existent user. sam suggests searching the database for the user ID to see if any records are left behind. After checking the topic_users table, bartv finds nothing. sam proposes that the issue might be due to the user watching all posts with mailing list mode enabled, but bartv can’t find any relevant records.

codinghorror asks if there are any third-party plugins installed, and bartv confirms that there are, but wants to investigate the database before disabling any plugins. Eventually, bartv suspects that the issue is caused by the Follow plugin.

Hi,

My users are reporting an issue where they will keep getting the same notification for new posts. I’ve tracked it back to a non-existing user, and it seems Sidekiq keeps retrying these notifications which results in the these people getting the notification multiple times.

I have killed these retries in the past, but they’ll resurface after a while. Shouldn’t they just ‘give up’ and not retry?

This is odd for sure. Can you sweep the DB searching for user_id 44269, maybe when we nuke the user record we left it around in some tables and this is triggering the issue.

‘Sweep’? Is there a quick way to do that, or do I need to inspect every table separately?

You would need a script for it. I would start though by looking at topic_users

Done; it returns nothing. Any other tables that could trigger this?

select *
from topic_users
where user_id = 44269

Very weird… maybe the user is watching all posts … had mailing list mode enabled and now has orphan records for watching stuff.

I looked in the Data Explorer but can’t find anything relevant. Do you have other suggestions where I can look?

I’m traveling this week, but when I’m back I can download a DB dump and do a search for this value too, I suppose.

Do you have any third party plugins installed?

Yes, a few. But I’ll dive into the database first before disabling anything on my production box.

I think I tracked this down to the Follow plugin.