Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Adrek on July 18, 2021, 10:49:00 AM

Title: Topic notifications are sent multiple times
Post by: Adrek on July 18, 2021, 10:49:00 AM
Hi, recently I was asked to solve few issues on some site, one of this issues is that SMF will send even up to 9 email notifications about the same topic reply. I tried to look in notifications function for doubled code but didn't find anything.

The I made test topic, and noticed that in my test profile the same topic was added twice under Notifications tab.
Has anyone had this issue? It may be related to some modifications - I have no idea what was happening before.

Quote
Version Information:
Forum version: SMF 2.0.15 (more detailed)
Current SMF version: SMF 2.0.18
GD version: 2.3.0
Database Server: MariaDB
MySQL version: 10.5.9-MariaDB-1:10.5.9+maria~focal
PHP: 5.6.40-47+ubuntu20.04.1+deb.sury.org+1
Server version: Apache/2.4.46 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f
Yes, I know SMF is outdated, but I'd like solve notifications problems before update.

Installed mods:
Quote
1.   YandexGarland   1.3.3
2.   Tapatalk SMF 2.0 Plugin   4.4.1
3.   EU Cookie   1.3.1
4.   SMF External Image Proxy   1.0.0
5.   httpBL   2.5.1
8.   Simple Audio Video Embedder   4.2.1
9.   PM Attachments   2.6
10.   Annoy User   1.2.4
13.   @mention members   1.1.2
14.   Highslide Image Viewer   1.7
15.   Post and PM Inline Attachments   4.15
16.   TinyPortal   1.2
19.   JDALIP - Join Date And Location In Posbit   1.3.2
21.   Personal Messages to Membergroups   1.4.3
23.   Prevent Adding Signature Images And Links   2.0
25.   BBC [you] Tag   1.3
26.   markItUp! for SMF   0.5.4
27.   Anti-Spam Links   1.0.1
30.   Age to DOB   1.1
31.   Default_Membergroup   2.0
32.   SimpleColorizer   1.1
33.   Simple Off-Topic BBC   1.0
34.   Enhancements to unread posts   1.0
35.   PM Quote   1.0
36.   reCAPTCHA for SMF   0.9.8a
37.   Happy Birthday   0.3
38.   Vimeo_bbc_code_Mod   1.0
39.   Facebook Slide Like Box   2.1.3
40.   dQuoteSelection   2.5 b2
41.   Bookmarks   2.5
42.   Show your social networks   4.0
43.   Add Social Media Icons To Profiles   1.1.0
44.   Limit Karma   1.4
45.   Previous and Next Links for Page Index   2.1.204
46.   Add Avatar To Who Is Online Version 1.1   1.0
47.   PM Notification Bar   2.0

again - I don't know what was installed before and if it was removed properly, but is someone could point me in right direction.. :)
Title: Re: Topic notifications are sent multiple times
Post by: Aleksi "Lex" Kilpinen on July 18, 2021, 11:02:04 AM
I would actually suggest it's usually better to update first, and only then tackle any possible issues still there.
As for this issue, are the multiple notifications actually separate emails or could it be that the email server is simply having a stroke? I'm not familiar with all of those mods, but none of those seem like they would mess with notifications.
Title: Re: Topic notifications are sent multiple times
Post by: Adrek on July 18, 2021, 11:18:30 AM
I got two separate emails with the same time (Webmail and Thunderbird set up as IMAP).

Here's what it looks like in my Notification tab in Profile after subscribing to topics and one board https://imgur.com/a/SyrfhB2 topics are repeated 2-3 times and board is repeated 19 times



Quote from: Aleksi "Lex" Kilpinen on July 18, 2021, 11:02:04 AM
I'm not familiar with all of those mods, but none of those seem like they would mess with notifications.
That's what I was thinking, this mods shouldn't affect notifications for topics..

Registration emails are sent correctly. Only once.

Quote from: Aleksi "Lex" Kilpinen on July 18, 2021, 11:02:04 AM
I would actually suggest it's usually better to update first, and only then tackle any possible issues still there.
If I don't find any solution I might just do that and see what happens
Title: Re: Topic notifications are sent multiple times
Post by: Aleksi "Lex" Kilpinen on July 18, 2021, 11:39:59 AM
That pic does seem like there's something funky going on there - you shouldn't even be able to subscribe multiple times to a single item as far as I know.
Any errors in the log when you subscribe or unsubscribe to a topic or board?
Title: Re: Topic notifications are sent multiple times
Post by: Adrek on July 18, 2021, 12:36:43 PM
No related errors in logs.

Quote from: Aleksi "Lex" Kilpinen on July 18, 2021, 11:39:59 AM
That pic does seem like there's something funky going on there - you shouldn't even be able to subscribe multiple times to a single item as far as I know.
Ok, then why when I subscribe here to Modifications board I have this board listed only once? Even every topic I have subscribed is listed once.
Title: Re: Topic notifications are sent multiple times
Post by: Shambles on July 18, 2021, 12:44:14 PM
If you unsubscribe a topic on your forum, does it remove 2 notifications?
Title: Re: Topic notifications are sent multiple times
Post by: Adrek on July 18, 2021, 01:10:14 PM
Yes.
If I subscribe to one topic I get ~2-9 (appears to be random, different users gave me different numbers) "subscriptions" in profile, when I remove one it removes all.
If I subscribe to one board I get ~19 "subscriptions" in profile, when I remove one it removes all.

Here it works fine - subscribe one board/topic - get one board in Profile > Notifications.
Title: Re: Topic notifications are sent multiple times
Post by: Shambles on July 18, 2021, 01:47:11 PM
Can you download and attach your copy of Notify.php from the Sources/ folder?
Title: Re: Topic notifications are sent multiple times
Post by: Adrek on July 18, 2021, 01:58:23 PM
it's exactly the same as Notify.php from fresh package, compared in Notepad++, characters, encoding is the same
Title: Re: Topic notifications are sent multiple times
Post by: Shambles on July 18, 2021, 02:17:02 PM
^ ok, so no point checking that.

This smells of a database issue; the primary keys in log_notify are id_member, id_topic and id_board.

Do you have access to your DB, via (eg) phpmyadmin?

(https://i.imgur.com/mqnolJh.jpg)
Title: Re: Topic notifications are sent multiple times
Post by: Adrek on July 18, 2021, 02:57:16 PM
Seems that I was looking way to long at my screen because somehow I missed that. Missing Primary keys on all 3, fixed it and we will see if that helps :)

btw there are many more DB issues, missing AI etc..
Title: Re: Topic notifications are sent multiple times
Post by: Shambles on July 18, 2021, 03:15:18 PM
Good luck. The key issue here, was...err... keys, and their non-uniqueness in your case.
Title: Re: Topic notifications are sent multiple times
Post by: shawnb61 on July 18, 2021, 03:50:28 PM
Good catch, Shambles!
Title: Re: Topic notifications are sent multiple times
Post by: Ninja ZX-10RR on July 18, 2021, 09:59:42 PM
Loved the pun, too ;D