Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: FrizzleFried on March 28, 2022, 07:51:43 AM

Title: Alerts Help
Post by: FrizzleFried on March 28, 2022, 07:51:43 AM
The continual drone of how bad the Alerts system works is driving me crazy.  Why are some of my members getting alerts 3 day later when they've been active for all 3 of those days?

It's nuts.  I added some code to call some file every minute via a cron job and it has not fixed the issue (yes,  I spelled it cron not chron).

What is going on with these alerts that they are so off-timed?!?

I think my users are spoiled because we had the SMF Packs alert system in 2.0.x and it was rock solid.

They use ajax to check on alerts every x number of seconds.

Is there a way to disable the alert system?  This is driving me crazy.  I have at least 3 or 4 people ******ing about it daily.. and I have to admit,  after really paying attention... yeah,  it's not good.

Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 08:04:06 AM
Just happened to me.  I was just dropped 3 alerts in a row from 7:20 to 8:30PM last night.  I was on my forum working on it at least until midnight.

Again... i do have the CRON.PHP being hit once a minute.

Also,  I just checked and I don't see any way to simply remove alerts.

...and this was the last PM sent to me.

QuoteJon,  the entire purpose of an alerts system is thrown out the window if it can't deliver the alert in a timely fashion.  You should just remove the system if you can't get it to work right.


EDIT: Sorry guys... I'm a little bit of a Debbie Downer on this as I thought we'd fixed this with the Cron job that I set up a couple days ago... but yeah,  a PM and multiple complaints on the dedicated UPDATE thread says otherwise.

I'm learning that patience & users go together like patience & toddler.

Title: Re: Alerts Help
Post by: Arantor on March 28, 2022, 08:53:31 AM
We never actually looked at what the alerts *are*. Are they likes, are they "you've been quoted", new reply in the topic?

If the system were as bad as you're saying we would have noticed it here on this site which is operating at higher load than most SMF sites - and they've not misbehaved like that.
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 09:01:01 AM
Quote notifications aren't alerting on time...

QuoteYesterday at 08:35:18 PM
Quote from: bottlejunkie on March 25, 2022, 09:18:13 PM
I don't get it, I mean. I get it but to be honest I checked KLOV in the morning with coffee BUT THEN aha WAS FIRST BUT BOTH WAS DAILY for a long time,
I literally JUST got a notification for this quote. Alerts are working fine |AHA|

Note that yesterday at 8:35PM (March 27th) she got an alert for a quote from 9:18PM on March 25th.  This woman had logged in multiple times on the 25th after 9pm,  multiple times on the 26th,  and multiple times on the 27th.... when all of a sudden at 8:35PM she got the quote alert.

PERSONALLY,  the 3 alerts that popped up today for me (that were supposed to be generated yesterday early evening) are add-on alerts for the SMF-HACKS Awesome Post Ratings mod... which you have no control over of course... but it's not just those (for sure).


EDIT: To be clear,  when she says "Alerts are working fine" ... the smiley tag at the end there is a "GIVE ME A BREAK" type of smiley.  That was a smar-arce comment.  Alerts are not working fine unfortunately.


Title: Re: Alerts Help
Post by: Arantor on March 28, 2022, 09:10:03 AM
That's really not what it says.

The date/time on the quote is when the original post was made. NOT when the quoting act was carried out. The date/time on the quote is how SMF has always worked, to cite the time of the original post.

Example. It is 14:08 my time as I write this post, here I am quoting the first part of your post, that is from 12:51 my time. What does it tell you, exactly?

Quote from: FrizzleFried on March 28, 2022, 07:51:43 AMThe continual drone of how bad the Alerts system works is driving me crazy.
Title: Re: Alerts Help
Post by: Kindred on March 28, 2022, 09:29:01 AM
I can not recreate any of the problems you are mentioning, Frizzle...    both here on Simplemachines.org and on my test site, alerts seem to happen within a reasonable time frame -- heck, my test site is barely touched by any users other then me and search engines -- and I still get alerts in a reasonable timeframe (within the hour, if not even sooner)
Title: Re: Alerts Help
Post by: Doug Heffernan on March 28, 2022, 09:53:01 AM
I can not reproduce this type of delay with alerts either. What browser are you and your users using @FrizzleFried? The one who are experiencing that kind of delay I mean.
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 10:12:48 AM
Quote from: Arantor on March 28, 2022, 09:10:03 AMThat's really not what it says.

The date/time on the quote is when the original post was made. NOT when the quoting act was carried out. The date/time on the quote is how SMF has always worked, to cite the time of the original post.

Example. It is 14:08 my time as I write this post, here I am quoting the first part of your post, that is from 12:51 my time. What does it tell you, exactly?

Quote from: FrizzleFried on March 28, 2022, 07:51:43 AMThe continual drone of how bad the Alerts system works is driving me crazy.

I explained the situation.  TRUST ME... there will be some evidence from the members I am sure of it that I will post back.

NOW MY EVIDENCE... but it's something you guys can't really say anything about because I can say FOR SURE 100% that I received this morning alerts for ratings (SMF Hacks Awesome Ratings Mod) that have a time stamp of yesterday between 7 and 9pm ... and I was on my site until about 11pm messing with it...

I dunno.  I'll keep trying to keep track but man I have much better things to do but they wont stop with the complaints (meaning SOMETHING is wrong or different vs the other alerts mod enough to warrant it).

:o

FWIW the other alerts mod was instantaneous.  1 second and the alert popped up.  Every time.  All the time.
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 10:20:30 AM
Wait. I just followed that quote link and the quote WAS generated on March 25th... a little later but it WAS MARCH 25th.  It should have alerted on March 25th...not yesterday (March 27th) at 8:35 right before the lady posted that it was not working.  She had been online plenty of times between March 25th when the quote was created (and should have been alerted) and the 27th at 8:35pm (or right before).

It's broke over here... and I don't know why or how.

My moderator just posted a TEST POST.  I quoted it.  I rated it.  I am waiting for him to reply as to when he receives the alert.

EDIT: NOTE - He is on mobile.  I can also provide images he's posting on the matter if necessary.

FWIW,  he said he'd reply when he got the alert.  He's not replied yet.  It SHOULD have been within 1 second based on the fact I'm running cron.php every second... no?
Title: Re: Alerts Help
Post by: Arantor on March 28, 2022, 10:27:37 AM
The other alerts system is significantly more load on the server. It would literally have never been approved for this site. Specifically when we sat and evaluated it, we figured this site would have needed another 2 servers *just* to cope with the alerts handling in that case. Which is why it runs the way it does, to not need a super beefy server.

In any case I continue to believe there is a misunderstanding about how it works, not that it is not working correctly.

I'm not at my dev environment right now so I can't write the query but the next step is to query the database to look at notifications triggered by messages and what time the alert was triggered vs what time the message was created.

Also, every second? WTF? We said every minute.
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 10:42:25 AM
I've created a dedicated thread to test... Thus far one person (one of my moderators) tested and received an alert for "quote" "mention" and SMFHACK's rating system within a timely fashion (he admits to not paying attention for a number of minutes then they were there).

I've asked everyone who is complaining to please participate by responding.  I will then quote,  mention,  and rate each to see the response.

That's about the best I can do I think...
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 11:08:38 AM
Can someone explain exactly how "Timeout for Alert desktop notifications" works so that I can instruct my users.  I suspect some are running in to THAT issue.

I just had this posted:

QuoteSo one thing I noticed that might be related...if I look at my alerts right now, it only shows 3 alerts. And most of them are pretty old. But if I clock on "all alerts" to see the full list, then it shows me a ton of them including very recent ones that did not show up otherwise.

Also:

QuoteHere is what I mean:

Clicking the bell only shows 3 alerts. Only two of which are from yesterday.

39135F51-3D42-4D75-AFD7-D72AECF3D59B.jpg


But clicking on All Alerts shows that I clearly had a lot more than that yesterday:


30A798D4-4B37-4A54-886D-5DEF6DA5528B.jpg

Next guy (same guy as above) claims...

QuoteNeither of them added to the count under the bell or showed up. But they both show up if I click "All Alerts".

...I'd quoted the post I quoted above and and mentioned him. 
Title: Re: Alerts Help
Post by: Arantor on March 28, 2022, 11:25:17 AM
The popup's number shows *unread* alerts. The alerts page shows *all alerts*. The "mark unread" is not super clear that it's offering to make an alert unread.

What can also happen is that if you view a topic where you received an alert about it, even if you didn't go to that alert specifically it can be marked read for you.
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 11:30:42 AM
I don't think I am explaining correctly.

Someone can get 10 alerts.  Only 3 will show on the index... then when all alerts is clicked all 10 show (and then some).

Here is the next user complaining about the very same thing.

QuoteAnother users test...

QuoteAll morning (my day starts at 5am), I had no Alerts.

When I came back after my last post in this thread, I had 2 Alerts (I just typed in 'www.aha-forums.com' to get here), but there were 4 Alerts in the drop down.

As soon as I clicked 'Unread Posts', the Alerts number jumped to 4, and it was the same alerts in the drop down.

Note that one alert is from yesterday, and I didn't see it yesterday or today until I got alerts from this thread.

alerts01.jpg alerts02.jpg


I just can't this is working right when so many people are having so many issues.

There is no reason why you should have 10 new alerts... and only 3 show up on the (3) tag...

How can I set things so that if someone gets 10 alerts... it shows (10)?

I still don't understand how someone can get 2 alerts... they NOT show up at all in the (#) part up top and then they DO show up in the all alerts.  Those two alerts never alerted???
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 11:35:06 AM
Quote from: Arantor on March 28, 2022, 11:25:17 AMWhat can also happen is that if you view a topic where you received an alert about it, even if you didn't go to that alert specifically it can be marked read for you.

This is a logical explanation. I've mentioned it to the user.  I am waiting to see if he says he came in the thread at any time before he noticed the alert in the ALL ALERTS section.
Title: Re: Alerts Help
Post by: Arantor on March 28, 2022, 11:38:19 AM
I understood you just fine.

The alerts drop down menu shows the alerts that you have not yet read. The alerts page in profile shows all your alerts, even if you have read them.

By "read" I mean you have either explicitly clicked on them to go to the content they're about (e.g. a post of yours is liked, you click on it to see the post = mark the "your post was liked" alert read), or you have gone to the topic in question (a post of yours was quoted, you went to the topic anyway, no need to alert you further that you were quoted)

Does the fact that the full alerts (all alerts) page say "mark read" for some and "mark unread" for others not clarify that there is something different about them?

As for the 2 vs 4 mismatch, there were 2 alerts you hadn't read at the point the page was loaded. When the drop down was opened, the live list of alerts was loaded and two more had come in, this is not live updated to avoid putting strain in the server.

Honestly, at this point just get Nibogo to update his mod for 2.1, your users will never be satisfied with what 2.1 offers out of the box precisely because it's designed to not impact servers with live updates.

I wish I'd never designed this damn thing at this point.
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 12:17:57 PM
I suspect we may have determined part (if not all) of the issue.


We were not aware that if you have X number of alerts up top... and you visit the thread where those alerts were generated (without clicking anything to do with the alerts)... it makes those alerts up top disappear.

THAT is the primary confusion I suspect.

Is there any way to STOP that behavior?  The alerts should remain NEW ALERTS until you actually click on them.  Just because someone visits a thread doesn't mean they are aware they were quoted...or mentioned... or rated.   Alerts up top should remain until either (a) they time out (whatever that is...time or number of alerts... I am still not sure) or (b) they are clicked on.

Is there any way to make the system behave in that fashion?

Title: Re: Alerts Help
Post by: Arantor on March 28, 2022, 12:37:37 PM
Not without changing the code, and it isn't the whole thread (or shouldn't be), just for the page you're on, on the assumption that if you visit page 2 of a thread and you're quoted in page 2, you will likely see it there.
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 12:54:35 PM
Well... I wish that misunderstanding of how things work now (vs the other alerts system) was the whole of the complaints.  It's not (thought it may be a big chunk).  Still compiling.

>sigh<
Title: Re: Alerts Help
Post by: Arantor on March 28, 2022, 12:55:49 PM
You mean the others like Facebook and XenForo that work the same way?
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 01:04:15 PM
No idea.  We are basing our experiences on the last alerts system we had (SMF Packs alerts for 2.0.x)...

I THINK maybe XenForo works the same way (keeps alerts until you click or they time out).  I don't do facebook much to be honest.
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 01:12:03 PM
Sigh...

It's just begun.  I would be bumping this thread continually if I posted all the people posting examples of alerts that showed up in their all alerts that never showed up top including posts they never went in to.

Hell,  this guy never got this alert... and there isn't even any buttons to the right in the ALL ALERTS section...


QuoteSaw this thread bumped, but I had no alerts.  Checked "All Alerts" again, just to see if I was missing one before clicking into this thread...

And I had a new one in "All Alerts" but there was never a notification number

alert2.jpg
Title: Re: Alerts Help
Post by: shawnb61 on March 28, 2022, 01:15:27 PM
It may help to distinguish the alert list from the menu counter in this discussion...  The alerts - e.g., if you have been quoted, mentioned, etc., stay in your alerts list.  The alerts list is always visible if you press the "All Alerts" button - there is a lot of history there that won't go away until you delete it.  The "new alert" counter will disappear from the menu if you have read the item.  (There is also a timeout setting under Notifications that you can tweak - I would leave it at 10, the default for now.)


If you continue to see the multiple-hour delay in alert visibility, I would suggest looking at a few things:

1)  An easy way to test the speed of alerts is to logon to two different users in two different browsers on your computer.  It's important to use two different browsers, or it won't work...  E.g., use your 'user' account in Firefox and your 'admin' account in Pale Moon.  PM each other.  Quote each other.  You can see the behavior first-hand quite easily.  Any delays become quite apparent.

2)  If there really are multiple-hour delays, I would check how many rows are in smf_background_tasks.  When an update is made, a background task gets queued to hunt around & determine who/how many alerts need to be generated.  If those are truly queueing up, you should see many rows in smf_background_tasks.  Who knows?  Maybe something is busted & clogging up your background task queue.  I'd pay careful attention to those.  Under most circumstances, that table should be empty, meaning, everything is caught up.

3)  The other thing I'd check is your browser console.  There is .js involved in updating that counter.  If something has broken that .js (e.g., mod conflict, jquery shenanigans, etc.) you will likely see an error in the browser console. 

Hope this helps,
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 01:48:45 PM
I think I see a small part of the confusion...

Look at these two images.

Top one shows 5 alerts... bottom 4.

The top one actually only shows 4 alerts though... the 5th is off-screen (you can see a tiny bit of the avatar).  The drop down needs a scroll bar or to be larger.

This is on mobile...not sure if that's the same on non-mobile.

alert3.jpg

alert4.jpg


He was arguing that bottom alert just popped in that it was old... but it really wasn't... it was hidden below the window...

Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 02:01:15 PM
Nevermind... moderator explained that he knew that alert was there but that was pointing out that it had appeared literally minutes before HOURS after the alert should have been generated and he'd already participated in that thread multiple times over those hours.

It still appeared.

Hours later.

Even though he'd participated.

Crazy.

There doesn't seem to be a way to pin-point the issue.  Sometimes alerts are instant (or almost). Sometimes it takes hours.  It seems to affect some more than others (or they are more sensitive to it).
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 02:29:09 PM
Any idea why the menu counter would say (2) but it would show 4 alerts?


alerts (1).jpg

Or why the two additional menu counter alerts were from nearly 3 weeks ago?!?
Title: Re: Alerts Help
Post by: Kindred on March 28, 2022, 02:40:30 PM
you keep posting these statements (the screen shots literally tell us nothing) and yet, none of us can recreate your issue.

There has to be something on your server or a mod you have installed that has crippled the system if it's taking hours.

Seriously -- even on my test site, with something like 3 real users, I get alerts in minutes.
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 02:51:50 PM
Sorry guys.  I'll try to figure things on on my end.
Title: Re: Alerts Help
Post by: Kindred on March 28, 2022, 02:56:56 PM
we're willing to help you debug, but you also have to be willing to accept when we tell you how something was designed to work (since you seem to have several mistaken impressions to start) and then also, be willing to accept that your site appears to have some oddness - either due to a mod (or combination of mods) or server configuration that is preventing the system from acting as expected.

Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 03:06:35 PM
I accept that fact (that the problem likely exists because of a mod)... but you have to look at the history of this (and my prior post on this that I should have added to rather than make this post).  It took me a long while to determine if there WAS a problem.  My members were reporting issues.  I was reporting the issues here and was being told it was normal operations.

Adding the cron job was supposed to rectify the issue... I thought it did... but it didn't.

Today I came in still not 100% sure if there was an issue or not based on some of the posts on how the alerts were supposed to work vs what I was "expecting" (based on my prior experience with a different system granted).

I'm not blaming anyone or feeling bad about anything... I'm sorry I wasted your guys time with this issue. I'll try to determine what mod is causing my issues.  I have like 18 or so at the moment... it shouldn't be THAT hard to figure out on a test site.

It should be one of the earlier mods that I installed because I've been getting complaints from day one on this matter.  Of course I installed about 8 mods day one.

Title: Re: Alerts Help
Post by: shawnb61 on March 28, 2022, 03:28:02 PM
Alerts are stored, & most only go away only after you explicitly delete them.  Yes, they will hang around for weeks if you don't clear them out.  At the bottom of the list is a "Delete all read alerts" button.

The 2 in the menu counter is telling you you have 2 unread recent ones.  It's not a count of the whole list.  That list is cumulative.

This is admittedly more clear on desktop vs mobile, where you can show more.

Given the questions above, I am now wondering whether there's an issue at all...   Yes, old alerts are in the queue...  That doesn't mean you just received them.  Maybe you received them weeks ago?


If you are still convinced there is a long delay...  Did you try the 3 things I listed above?
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 04:29:28 PM
That list is the drop down from the alerts button ... not the alerts pop up (all alerts).  Are you saying that normal operation is supposed to list more alerts in that alerts drop down than the number showing?

So if (2) Alerts are showing and I click that,  it's normal to show more than 2 alerts in there?

Seems... not right... saying it.  And in practice?

See what I mean @Kindred  ... it's still debatable as to whether there is an actual "issue" in the eyes of SMF...

My users will argue there is a problem.  Lots of them will.  But I guess that doesn't make it so.


Title: Re: Alerts Help
Post by: shawnb61 on March 28, 2022, 04:39:56 PM
We're still trying to understand if there is a problem...

Quote from: shawnb61 on March 28, 2022, 03:28:02 PMIf you are still convinced there is a long delay...  Did you try the 3 things I listed above?

Third request for this info.   :)
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 04:53:55 PM
My apologies.  I am working and attempting to handle this between that.

I essentially did that earlier today when I asked my users to reply.  There were cases where it took a long time for alerts to appear.

I will log in with two different browsers... two different users... and test when I have a chance.
Title: Re: Alerts Help
Post by: shawnb61 on March 28, 2022, 05:44:33 PM
Quote from: FrizzleFried on March 28, 2022, 04:53:55 PMI will log in with two different browsers... two different users... and test when I have a chance.

There were 3 reqests - don't forget the other 2!   :)
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 05:54:44 PM
I am a newb.  How do I accomplish the other two?

As for the 1st...

I just put two windows side by side. 

One side one user (my admin account)

One side another user (test user standard acct)


I then posted with my admin account.

I then went in with the regular user account and rated, mentioned, quoted.  Every one of them triggered an alert at the top drop down within 3 seconds.  PERFECT.  I did this for two other posts... every one of them working exactly as it is supposed to.

I then went in with my admin account and rated and quoted the responses that I made with the regular account.

I never (still) got the alert up top.  I actually have an ALL ALERTS page filled with multiple items that have MARK READ as an option as opposed to MARK UNREAD.  Still...after posting this...no alert up top.

On a hunch I went in and posted a topic with my regular account.  I then quoted that regular account... guess what happened... all 8 of the alerts hit at once.

It sounds like the alerts are not working right when someone posts something within someone elses post... but it DOES work perfectly when it's your own post?!?

Does that sound logical at all?

Basically if it's your own post,  all alerts are working.  If you respond to someone elses post and someone say quotes you in that post,  the alert is iffy at best.

To bolster this argument... i just went and quoted that regular accounts post again... and sure enough... quickly... the alert hit that regular account.

That has got to be it.

If I had two accounts here I would check that.

I'm going to go check my test site which is currently bone stock.  Will get back.

...and unfortunately (for me,  not for you guys!) the behavior does NOT occur on my sandbox site.  That means there is FOR SURE a mod causing issues. At least I will be able to add each mod one at a time and test on the sandbox site to determine the offending mod... unless someone else has better ideas (or wants to fill me in on how to do what was recommended earlier)

Thanks!

Posts merged on this page and on the first page.  Please avoid serial posting within short time periods and use the modify button instead - Iris.
Title: Re: Alerts Help
Post by: Arantor on March 28, 2022, 06:48:09 PM
Did you reset your cron job to run once a minute?

Also, if you look at the database, at the smf_background_tasks table, how many rows are in it?
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 08:01:45 PM
Quote from: Arantor on March 28, 2022, 06:48:09 PMDid you reset your cron job to run once a minute?

Also, if you look at the database, at the smf_background_tasks table, how many rows are in it?

I did set the cron job to run once a minute.

I will see if i can find the background tasks table.
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 08:32:03 PM
...really having a hard time finding the background tasks table in Cpanel.  Any suggestions as to where to look?
Title: Re: Alerts Help
Post by: shawnb61 on March 28, 2022, 08:36:17 PM
Quote from: FrizzleFried on March 28, 2022, 06:12:36 PMThat means there is FOR SURE a mod causing issues. At least I will be able to add each mod one at a time and test on the sandbox site to determine the offending mod...

Perfect, so now we know it's a mod.  Once you isolate the mod, please report in that mod's support thread so they know.

Thanks for your perseverance.

I doubt you need the cron.  I don't, even on my localhost with zero traffic.  You could confirm by repeating the test with the cron off (which is what you did already in your sandbox, right?).  If you don't need it, you don't need it.

Yes, please confirm background_tasks.  It's possible that's how the mod is broken, and you may still have to clean out some broken tasks to get everything humming along again.  You can look at that table via phpmyadmin.  Ideally it's empty, or if not empty, any rows in there are very short-lived.
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 08:37:33 PM
I assume the cron running for my main site doesnt' affect the test site on the same server but in a different folder... ?
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 08:38:23 PM
I poked around phpmyadmin ... but I'll re-try. 
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 08:51:58 PM
I really have no idea what i am doing.

I found the background table.  There is nothing in there.  If i setup an alert it will pop in with some data (if I refresh)... then that data goes away once the alert is delivered.

Well,  the times it doesn't want to deliver the data it just sits in there...

I don't see an error nor any indicator of what may cause it to sit in there.

But again, I freely admit I have very little clue as to what i am doing.

EDIT as a matter of fact... the one that stuck is still stuck in there... multiple minutes later.

Not sure if this data is helpful ... because again (look up for the reason).

;)


{"msgOptions":{"id":842453,"subject":"Re: TEST","body":"[quote author=Sasquatch link=msg=842412 date=1648504033]<br>That mention took the longest... maybe 5 seconds.<br><br>[\/quote]<br>[member=22]Sasquatch[\/member]&nbsp;test","icon":"xx","smileys_enabled":true,"attachments":[],"approved":1,"poster_time":1648514932,"send_notifications":true,"quoted_members":{"22":{"id":"22","email_address":"[email protected]","lngfile":"","real_name":"Sasquatch"}},"mentioned_members":[]},"topicOptions":{"id":35042,"board":"13","poll":null,"lock_mode":null,"sticky_mode":null,"mark_as_read":true,"is_approved":true,"first_msg":"842408","last_msg":"842451","redirect_expires":null,"redirect_topic":null},"posterOptions":{"id":1,"name":"FrizzleFried","email":"[email protected]","update_post_count":true,"ip":"194.60.86.5"},"type":"reply","respawns":1}
Title: Re: Alerts Help
Post by: shawnb61 on March 28, 2022, 08:55:05 PM
Quote from: FrizzleFried on March 28, 2022, 08:51:58 PMI found the background table.  There is nothing in there.  If i setup an alert it will pop in with some data (if I refresh)... then that data goes away once the alert is delivered.

That's perfect!  That means requests are properly logged & getting processed on an ongoing basis. 

Isolate the problem mod, deinstall it, and you are done. 
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 08:58:01 PM
Any pro-tips to determine which mod or I guess I should start from mod 1 (there are dates of installation from my recollection) and work my way though them.

I honestly think I may have broke the system from day one... so it's likely one of the early mods.

Title: Re: Alerts Help
Post by: shawnb61 on March 28, 2022, 09:00:49 PM
I would go in your vanilla sandbox environment.  Install them one by one, and repeat your tests after each mod install.

The first one I'd try would be the rating one, since you said that is one of the actions you took when you saw the failures.
Title: Re: Alerts Help
Post by: FrizzleFried on March 28, 2022, 10:13:14 PM
I have determined the offending mod.  It's a commercial mod and I've reported the issue to the creator.  Once removed,  the system works pretty much exactly as I (and my users) expect it to (thus far).

THAT was fun.
Title: Re: Alerts Help
Post by: FrizzleFried on March 29, 2022, 10:18:38 AM
OK.  The offending mod WAS the Awesome Ratings mod from SMFHacks (https://www.smfhacks.com/) ...

This alert system is new for everyone and there are some growing pains as expected.  I reported the issue to the folks at SMFHacks (https://www.smfhacks.com/).  Immediately they set upon to determine what was going on.  That was about midnight my time last night.  About 10 minutes ago I installed an updated version of the mod that appears to have FIXED the issue!  I am getting my alerts in a timely fashion as expected!

I highly recommend the Awesome Ratings mod from them... and I'm happy to say they are quick on the ball when it comes to support!  Awesome Ratings... Awesome Job!

EDIT: I would also like to thank everyone here for putting up with me yesterday.  After weeks of complaints about this issue I decided yesterday was the day I was GOING to get it fixed one way or another and at times I'm sure I came off as a little pissy.  Never at you folks... always at my inability to handle things myself to be honest.  Thank you for helping me work my way through this and I apologize to all the users for bumping the heck out of this thread throughout the day. 

Jon

Title: Re: Alerts Help
Post by: KittyGalore on March 31, 2022, 02:54:18 PM
Quote from: Kindred on March 28, 2022, 09:29:01 AMI can not recreate any of the problems you are mentioning, Frizzle...    both here on Simplemachines.org and on my test site, alerts seem to happen within a reasonable time frame -- heck, my test site is barely touched by any users other then me and search engines -- and I still get alerts in a reasonable timeframe (within the hour, if not even sooner)
I have this issue on this site i have on some topics to receive alerts up till an hour ago i see the topics i receive alerts on there was nothing shown and nothing shown for them in a few days just now i opened this forum and have 46 alerts.

Using google chrome and Windows 10 on PC

.alerts 1.PNG alerts 2.PNG
Title: Re: Alerts Help
Post by: Shades. on March 31, 2022, 10:07:08 PM
I'm having same problems! I've seen this post (https://www.simplemachines.org/community/index.php?topic=581652.msg4118415#msg4118415) a dozen times today and just now got an alert for it, 8 hours later! ???
Title: Re: Alerts Help
Post by: shawnb61 on March 31, 2022, 11:24:36 PM
I think some of the confusion here is due to the fact that if you visit the thread, it will flag the alerts as being read. 

Back during the RCs, folks were complaining about being spammed by hundreds & hundreds of alerts.  So measures were taken to minimize alert spam.  E.g., if you read the thread, you will see that alert counter drop.  There is no need to alert you to go read the thread if you have since read that thread.

So, in many cases, what is happening is that the alerts go away because you've read the thread.  But you leave the thread, and something else happens & triggers a new alert, leading you to think one took hours to get to you.

So... 

If you think you see delays going forward, two requests. 
(1) Take a screenshot of the delayed alert to help us diagnose what happened.  As noted above, different alert types behave a little differently.  We need to know exactly what you are seeing.
(2) Check your browser console.  The alerts are dependent on .js, and if you're having .js issues, that will impact things as well.

Actually, 3 requests...
(3) Start a new thread.  The one was resolved.  It was due to a mod conflict.
Title: Re: Alerts Help
Post by: FrizzleFried on April 02, 2022, 10:49:30 AM
I think part of the confusion was the decision to make alerts go away when you visit a page where the alert was generated.  That runs counter to what most people think SHOULD happen.  I know that I (and the majority of my users) expect an alert to remain until you click it (or ignore it by clicking READ ALL).  That seems to be the most logical behavior for such a thing.

While I do understand why you made the decisions you did,  you must realize that human beings,  being what they are,  expect things to work a certain way "naturally" ... and with it's current functionality of turning off all alerts of a page you visited ... it's really just feels "unnatural".

If there was a way to keep alerts up until a user actually ACTIVELY clicks on it... it times out... or a user click REAL ALL... I would be all over it as I am STILL getting complaints from my users (as you are here) because they don't understand what is going on... because the behavior of the alerts system runs counter to what most folks assume.

Actually... if this has to be a MOD... please,  put it in the proper place.  I would LOVE LOVE LOVE for the alerts system to behave in such a fashion (if only to stop my having to explain the way things do work to people over and over and over).

But to be clear ... yes ... my issues with the Alerts was related to a MOD (which has been fixed).
Title: Re: Alerts Help
Post by: KittyGalore on April 02, 2022, 12:44:46 PM
Quote from: FrizzleFried on April 02, 2022, 10:49:30 AMI think part of the confusion was the decision to make alerts go away when you visit a page where the alert was generated.  That runs counter to what most people think SHOULD happen.  I know that I (and the majority of my users) expect an alert to remain until you click it (or ignore it by clicking READ ALL).  That seems to be the most logical behavior for such a thing.

While I do understand why you made the decisions you did,  you must realize that human beings,  being what they are,  expect things to work a certain way "naturally" ... and with it's current functionality of turning off all alerts of a page you visited ... it's really just feels "unnatural".

If there was a way to keep alerts up until a user actually ACTIVELY clicks on it... it times out... or a user click REAL ALL... I would be all over it as I am STILL getting complaints from my users (as you are here) because they don't understand what is going on... because the behavior of the alerts system runs counter to what most folks assume.

Actually... if this has to be a MOD... please,  put it in the proper place.  I would LOVE LOVE LOVE for the alerts system to behave in such a fashion (if only to stop my having to explain the way things do work to people over and over and over).

But to be clear ... yes ... my issues with the Alerts was related to a MOD (which has been fixed).
I agree with you as well i want the alerts to be like you and your users. Since the 31st of March i haven't received alerts here on this forum for topics i'm watching so is it just me or is it the same for everyone here i don't know. I prefer to have the alerts to stay and be cleared by me. When i open the forum before i even enter any topic the alerts are empty so it's not just even me entering the topic for them to disappear without me releasing it. 
Title: Re: Alerts Help
Post by: Arantor on April 02, 2022, 12:50:01 PM
On your own forum, find this code in Sources/Display.php:

Code (find) Select
        // Mark any alerts about this topic or the posts on this page as read.
        if (!empty($user_info['alerts']))
        {
            $smcFunc['db_query']('', '
                UPDATE {db_prefix}user_alerts
                SET is_read = {int:now}
                WHERE is_read = 0 AND id_member = {int:current_member}
                    AND
                    (
                        (content_id IN ({array_int:messages}) AND content_type = {string:msg})
                        OR
                        (content_id = {int:current_topic} AND (content_type = {string:topic} OR (content_type = {string:board} AND content_action = {string:topic})))
                    )',
                array(
                    'topic' => 'topic',
                    'board' => 'board',
                    'msg' => 'msg',
                    'current_member' => $user_info['id'],
                    'current_topic' => $topic,
                    'messages' => $messages,
                    'now' => time(),
                )
            );
            $user_info['alerts'] = max(0, $user_info['alerts'] - max(0, $smcFunc['db_affected_rows']()));
            updateMemberData($user_info['id'], array('alerts' => $user_info['alerts']));
        }

Code (replace) Select
        // This is where the alert updating used to be.
Title: Re: Alerts Help
Post by: FrizzleFried on April 02, 2022, 02:46:25 PM
Awesome!  I will give it a go and see how things work out.   I will say that fixing the issue with the 3rd party MOD did alleviate the majority of the issues we were experiencing prior.

I do have a question though as well.  Has anyone else gotten multiple windows notices about the same alert ... over and over ... until you actually clear the alert by visiting the page of the alert,  or clicking read all etc?

Now, I  figure it may be the cron job but I am experiencing it on my sandbox test site mostly...
Title: Re: Alerts Help
Post by: aceone on April 03, 2022, 05:06:46 AM
Quote from: Arantor on April 02, 2022, 12:50:01 PMOn your own forum, find this code in Sources/Display.php:
Could somebody Please made a Mod out of it?
Title: Re: Alerts Help
Post by: Steve on April 03, 2022, 09:28:58 AM
Quote from: aceone on April 03, 2022, 05:06:46 AMCould somebody Please made a Mod out of it?
You need to ask that here: Mod Requests (https://www.simplemachines.org/community/index.php?board=79.0)
Title: Re: Alerts Help
Post by: Arantor on April 03, 2022, 10:10:12 AM
There you go. Hooks-only mod to achieve the same thing.
Title: Re: Alerts Help
Post by: Steve on April 03, 2022, 10:15:27 AM
Quote from: Steve on April 03, 2022, 09:28:58 AM
Quote from: aceone on April 03, 2022, 05:06:46 AMCould somebody Please made a Mod out of it?
You need to ask that here: Mod Requests (https://www.simplemachines.org/community/index.php?board=79.0)
Or you can catch Arantor on a good day.

(j/k Arantor  :P )
Title: Re: Alerts Help
Post by: Arantor on April 03, 2022, 10:15:49 AM
Quote from: Steve on April 03, 2022, 10:15:27 AMOr you can catch Arantor on a good day.

No, that really is about it. ;D
Title: Re: Alerts Help
Post by: aceone on April 03, 2022, 10:17:31 AM
Quote from: Arantor on April 03, 2022, 10:10:12 AMThere you go. Hooks-only mod to achieve the same thing.
Thank you.
Title: Re: Alerts Help
Post by: Steve on April 03, 2022, 10:28:40 AM
Can someone please summarize what exactly the problem is here. Every time I read through this topic I get more confused.

And is Arantor's mod something we should all install or is it because of the OP's particular setup?
Title: Re: Alerts Help
Post by: Shades. on April 03, 2022, 10:31:11 AM
Quote from: Steve on April 03, 2022, 10:28:40 AMCan someone please summarize what exactly the problem is here. Every time I read through this topic I get more confused.

And is Arantor's mod something we should all install or is it because of the OP's particular setup?
I had to look in the mod to figure it out because I was wondering the same thing lol! In the mod says "* Disables the behaviours for marking alerts read when visiting topics." ;)
Title: Re: Alerts Help
Post by: FrizzleFried on April 03, 2022, 10:46:15 AM
Quote from: Arantor on April 03, 2022, 10:10:12 AMThere you go. Hooks-only mod to achieve the same thing.

Awesome... I can now throw those notes away.

;)

Title: Re: Alerts Help
Post by: FrizzleFried on April 03, 2022, 10:51:54 AM
Quote from: Steve on April 03, 2022, 10:28:40 AMCan someone please summarize what exactly the problem is here. Every time I read through this topic I get more confused.

And is Arantor's mod something we should all install or is it because of the OP's particular setup?

Lets say you rack up 3 alerts on one single-page topic.  One for a quote... and lets say 2 for mentions.  One on the OP and one on the 9th response.

Stock behavior:

You visit the site and see you have 3 alerts.  You click say the first "mention" alert... it takes you to the mention in the OP... but it then resets your alerts to ZERO as the other two alerts are also on that same page.  The stock "assumption" is that you will see those alerts since you are already on the same page.

Updated behavior:

You visit the site and see you have 3 alerts.  You click say the first "mention" alert... it takes you to the mention in the OP... and it DOES NOT reset your alerts to zero.  You still have 2 alerts showing in the drop down at top.  You have to actively go in to those alerts and click on them... or you can click MARK READ... or they will eventually time out based on your settings.

@Arantor  ...do I pretty much have this right?  ALSO... can you please tell me,  is the TIMEOUT setting in minutes or number of alerts (does 10 mean 10 minutes or 10 alerts for example)? [answered below based on my search]

Title: Re: Alerts Help
Post by: FrizzleFried on April 03, 2022, 11:09:04 AM
NOTE: I just read after a search that the TIMEOUT setting is a polling interval?!?  Strange name to give a polling interval?  Evidently it's in seconds.  10 = 10 seconds.  So evidently my assumption there was an actual "timeout" setting for alerts was incorrect.  They'll stack up I assume until you either click on them or "mark read".  Is that correct Arantor?
Title: Re: Alerts Help
Post by: Max22 on April 03, 2022, 12:10:13 PM
The "Timeout for Alert desktop notifications" setting specifies the number of seconds to display the alert before closing it.

The alert notifications will appear at the top left in the box marked "Alerts", while the "desktop notification" will appear in the bottom right-hand corner of your browser window.

Mentioned by Oldiesmann in issue #3911 (https://github.com/SimpleMachines/SMF2.1/issues/3911#issuecomment-277037864)
Title: Re: Alerts Help
Post by: Arantor on April 03, 2022, 12:53:52 PM
I don't ever turn on the desktop notifications, personally. That was something I never about in the design but its point is to check every x seconds and update the number of the alerts you have. It doesn't expire alerts or anything like that, it's just about keeping that number fresh without you having to explicitly reload the page.

That said if you already opened the alerts panel that page load you won't see the updated alerts list because it doesn't refresh *that* AFAIK.
Title: Re: Alerts Help
Post by: FrizzleFried on April 03, 2022, 01:18:51 PM
So the timeout option at the alerts dropdown has to do with the windows notification that pops up at the bottom right hand corner of my monitor?  It's the number of seconds to display that notification at the bottom right hand corner?

Is that correct?

Title: Re: Alerts Help
Post by: Arantor on April 03, 2022, 01:22:44 PM
I don't actually know. I thought it was the frequency of checking in for updates.

As I say I have never turned it on (and it was added after I worked on the base of the alerts system). It's possible it doesn't work properly because I'm not actually sure what it is supposed to do.

(My browsing is between desktop and mobile and there is no situation where I'd want a notification like that.)
Title: Re: Alerts Help
Post by: FrizzleFried on April 03, 2022, 01:24:00 PM
QuoteDesktop notifications are an entirely different. This is a feature supported by many web browsers (Google Chrome and Mozilla Firefox for sure; not sure what other browsers support it) that shows a notification within the browser for something even if you're not viewing the site that the notification is associated with at the time. The "Timeout for Alert desktop notifications" setting specifies the number of seconds to display the alert before closing it.

That seems to suggest just that.  The labeling is about as clear as mud.

EDIT: Though re-examining... "Timeout for Alert desktop notifications" ... maybe a slight tweak "Time Desktop Notification Pop up Remains on screen at bottom right (in second)"... aim for the lowest common denominator (I'll lump myself in that!).. :)
Title: Re: Alerts Help
Post by: Arantor on April 03, 2022, 01:33:54 PM
Honestly, if that's what the feature is actually meant to do, I wouldn't have made it an option in the first place, I'd have left it up for 10 or so seconds, whatever felt good and it wouldn't be configurable.
Title: Re: Alerts Help
Post by: voom on May 18, 2022, 11:49:04 AM
It seems I have a problem that it does NOT work then it is supposed to. I just received 28 alerts accumulation since yesterday. All for citations, answers etc. Since then I had been checking for new posts myself many times and there were no unread items in the whole (still very small) forum for me at the time, when the alerts arrived. It seems to me that that was better when I first installed the forum.

I see no point in having alerts for things I have already seen, thus I want it the way it is meant to be, as opposed to the threadstarter.

At the moment, smf_background_tasks is empty.
Title: Re: Alerts Help
Post by: Arantor on May 18, 2022, 11:55:14 AM
That implies you had no visitors to the site in the meantime... things get put into a queue and something has to run the queue.
Title: Re: Alerts Help
Post by: voom on May 18, 2022, 12:13:52 PM
Quote from: Arantor on May 18, 2022, 11:55:14 AMThat implies you had no visitors to the site in the meantime... things get put into a queue and something has to run the queue.
I had visitors, few but very active. Anyway, I now set up a cron to run every minute. The cron runs "with 0 errors" as it notifies. I watch if that works better...
Title: Re: Alerts Help
Post by: Arantor on May 18, 2022, 12:38:45 PM
That's how I run my sites ;)
Title: Re: Alerts Help
Post by: voom on May 18, 2022, 05:27:53 PM
It makes sense, but it does not work for me as expected. Looking at the database, the entries come and go. The alerts come sometimes, alsmost much too late. The stuff that suddenly is alerted, I have read already. It is even more confusing by the time of the alert shown being the time it was issued, not the time the event happened. So I see the current time, think it is new - and it is something I have read and replied to hours ago.

What also confuses me, is that with the cron set and the js-function deactivated, nothing seems to happen at all. Sometimes, when I exec. the cronjob manually, a bunch of old alerts came at once. Another time: nothing. Then, turning the js-function back on: a bunch of old alerts.

Just in case someone has experienced sth. like that with one of the mods active in our SMF 2.1.2:

Title: Re: Alerts Help
Post by: Arantor on May 18, 2022, 05:49:39 PM
Of course the entries come and go in the background tasks table, that's literally the point.

Making a post adds a task to the background queue to process alerts. Cron running removes items from the queue and processes them. Thus the table gets items and empties out again.

As for your symptoms this indicates cron is not clearing things, what exactly did you set up as the cron task?
Title: Re: Alerts Help
Post by: voom on May 18, 2022, 07:14:39 PM
Quote from: Arantor on May 18, 2022, 05:49:39 PMOf course the entries come and go in the background tasks table, that's literally the point.
I know; I meant to state that that looks fine... Opposed to what I and other users experience on the forums....

Quote from: Arantor on May 18, 2022, 05:49:39 PMAs for your symptoms this indicates cron is not clearing things, what exactly did you set up as the cron task?
/path/to/smf-www-root/cron.php * * * * * (executing as root, as a PHP task in Plesk)
Title: Re: Alerts Help
Post by: Arantor on May 18, 2022, 07:24:44 PM
cron.php is not executable on its own, you need to have your cron task be the php executable (which will vary host to host, especially for hosts that have different versions of PHP available), and pass path/to/cron.php as a parameter.

E.g. on one of my sites, the command is /usr/local/bin/ea-php74 /path/to/cron.php
Title: Re: Alerts Help
Post by: voom on May 18, 2022, 07:40:54 PM
Thanks :)

Now it's: /opt/plesk/php/7.4/bin/php -q /path/to/smf-www-root/cron.php

I'll report tomorrow if it works now...
Title: Re: Alerts Help
Post by: voom on May 19, 2022, 08:27:41 AM
I am not sure, I have not received any alerts at all since setting up the cron. There was activity in a thread I started that is in a forum with activated alerts.

The cron puts out the following, which looks fine to me:

array(8) {
  [0]=>
  array(3) {
    ["file"]=>
    string(62) "/path/to/web-root/cron.php"
    ["line"]=>
    int(287)
    ["function"]=>
    string(9) "log_error"
  }
  [1]=>
  array(3) {
    ["file"]=>
    string(84) "/path/to/web-root/Sources/AutoEmbedMediaPro2.php"
    ["line"]=>
    int(415)
    ["function"]=>
    string(22) "smf_error_handler_cron"
  }
  [2]=>
  array(3) {
    ["file"]=>
    string(84) "/path/to/web-root/Sources/AutoEmbedMediaPro2.php"
    ["line"]=>
    int(229)
    ["function"]=>
    string(22) "MediaProisMobileDevice"
  }
  [3]=>
  array(3) {
    ["file"]=>
    string(70) "/path/to/web-root/Sources/Subs.php"
    ["line"]=>
    int(3840)
    ["function"]=>
    string(15) "MediaProProcess"
  }
  [4]=>
  array(3) {
    ["file"]=>
    string(89) "/path/to/web-root/Sources/tasks/CreatePost-Notify.php"
    ["line"]=>
    int(569)
    ["function"]=>
    string(9) "parse_bbc"
  }
  [5]=>
  array(5) {
    ["file"]=>
    string(89) "/path/to/web-root/Sources/tasks/CreatePost-Notify.php"
    ["line"]=>
    int(270)
    ["function"]=>
    string(26) "handleWatchedNotifications"
    ["class"]=>
    string(28) "CreatePost_Notify_Background"
    ["type"]=>
    string(2) "->"
  }
  [6]=>
  array(5) {
    ["file"]=>
    string(62) "/path/to/web-root/cron.php"
    ["line"]=>
    int(237)
    ["function"]=>
    string(7) "execute"
    ["class"]=>
    string(28) "CreatePost_Notify_Background"
    ["type"]=>
    string(2) "->"
  }
  [7]=>
  array(3) {
    ["file"]=>
    string(62) "/path/to/web-root/cron.php"
    ["line"]=>
    int(131)
    ["function"]=>
    string(12) "perform_task"
  }
}
Error loop.
Title: Re: Alerts Help
Post by: Arantor on May 19, 2022, 08:31:22 AM
No, that's the cron hitting a fatal error possibly caused by the media embed mod. More specifically, it's failing upon trying to put the error it encountered into the error log.

Cron.php encountering no errors reports no output.
Title: Re: Alerts Help
Post by: voom on May 19, 2022, 08:39:30 AM
Yup, I uninstalled the media embed mod and instantly alerts arrive....

The log error - could it be a file permissions issue? Or is the log in the db? What can I do about that?
Title: Re: Alerts Help
Post by: FrizzleFried on June 08, 2022, 11:22:41 PM
I really didn't want to revisit this crap again but my users just keep hounding me.

For example... this user would really like to know how in the hell he went from 15 alerts in one minute...

ALERTS1.jpg

(note the time)

To 105 alerts a minute later...

ALERTS2.jpg

I can't answer these questions with anything other than "The Alerts System is Fundamentally Broken"... because damnit,  I'm just done giving a damn about it.  I can turn that crap off,  right?  I think I might.  It's just... broke but I am sure there will be plenty here that will chime in telling me how wonderfully it works... which is maddening because it just doesn't.  I hate to say this but its 100% true... :(

Sorry guys.  I really don't like to crap on peoples code... but a duck is a duck and this one has been quacking since day one.

EDIT: Damnit... it's LIKES and MENTIONS that can be turned on/off.  >argh<
Title: Re: Alerts Help
Post by: Kindred on June 09, 2022, 03:52:40 PM
I don't believe it is broken -- unless one of your many hacks done by people who are not our developers broke it...
Title: Re: Alerts Help
Post by: Arantor on June 09, 2022, 03:55:25 PM
No, fairly sure the only hack to the alerts was the one I wrote, which just takes out some force-marking-written.

The real question is whether the 105 alerts are the real count and if that's just the delay of cron being run to chew through a batch of things.

Or even a rogue other job blocking the queue in the meantime.
Title: Re: Alerts Help
Post by: FrizzleFried on June 09, 2022, 04:31:45 PM
QuoteI don't believe it is broken -- unless one of your many hacks done by people who are not our developers broke it...

My perspective:

A "working" alerts system should not go from 15 to 105 alerts in 45 seconds... when that user had been on the site for minutes prior.  That is a broken system.  Sorry.

Even if it does that because of "technical reasons"... that doesn't make it any less broken.  I know it can be done better... I used to run a mod that did it better... so whatever you want to call it,  even if it's "working as intended"... it's working "broke".

It also has happened HERE to me... BTW... so there goes the idea of it being my forum only... and that's not taking in to account the other users here who have complained as well.

EDIT: BTW ... as Arantor pointed out... the ONLY change to original code was his code.

Title: Re: Alerts Help
Post by: Arantor on June 09, 2022, 04:39:20 PM
So, the first question, did the user really have 105 alerts? What was the timescale of them coming in?

Remember: you're not Facebook, you don't have a data centre. There *must* be a throttle of sorts for alerts being processed at scale; SMF has to cope with being both for tiny and massive sites. (If the paid alerts mod you had had been installed here, it would require another 1-2 servers to run it rather than the multiple servers it *already* has.)

So there is a queue in which tasks get carried out. The queue gets processed occasionally - pretty sure we advised you to set it up to check the queue once a minute with a cron task on the server.

I suspect that there are occasional clogs in the queue pipe which accounts for the spiky load that you have - but I still believe you were meant to get the 105 alerts until I hear anything otherwise.

I have to be honest, I haven't seen the issues you refer to myself on this site. That doesn't mean they don't happen, but I haven't seen them myself. The behaviours I see correlate to what I expect from how it was originally designed and later implemented.
Title: Re: Alerts Help
Post by: FrizzleFried on June 09, 2022, 04:39:44 PM
Oh,  and I am still in the dark how I could get 7 likes here in a post ... but only 2 alerts (in total)?  Seems broken...no?

It seems that if you stay on top of the alerts (as I do typically) ... all works well.  If I let them collect,  it gets stupid.

I'll see what I can do to collect more info.  That said... I really would prefer just to yank the whole damn thing if possle.  I bet I could remove the button easily enough... but all the related BS (profile stuff... alert settings stuff) would be too much to bother with.

At this point just responding with "It's broken..." just might be the way to handle things as I suspect it's not going to be 'fixed' anytime soon.

Sorry... the behavior (obviously due to tech issues it seems) just sucks... by design it seems.

Quote from: Arantor on June 09, 2022, 04:39:20 PMRemember: you're not Facebook, you don't have a data centre. There *must* be a throttle of sorts for alerts being processed at scale; SMF has to cope with being both for tiny and massive sites. (If the paid alerts mod you had had been installed here, it would require another 1-2 servers to run it rather than the multiple servers it *already* has.)

It did alerts right.  Maybe it's not possible to do alerts 'right' with a very large site... you know that more than I so I bow to your expertise.  But then how do sites like xenforo do things... right?  I've NEVER had 110 alerts just pop up on any Xenforo site... ever... not once. (I do have to admit I only frequent one but it's a major arcade site I visit daily).

EDIT: BTW... i am not trying to be argumentative.  I am simply stating a fact... the alerts are broken.  They do not work correctly (at least what an average user would expect would be "correct"... not the version of "correct" that is being espoused by some here).  Now,  if the official response to that is to try to blow sunshine up my skirt,  so be it... that's fine... but it does not change the fact.

EDIT #2: FWIW I am a little pissy today... my 12 year old son left his backpack at the San Diego International Airport... with nearly $1000 worth of crap in it (ipad, $350 heated gloves for my wife,  $150 headphones).... yeah... I'm not a happy camper today and reading my posts it seems to be shining through.  Maybe I need to walk away for a while. ;)  )

EDIT #3: Anyone got a Snickers? (only the US crowd would know this!)

:D

Actually, the UK 'crowd', as you put it, would also understand the references an dit was translated into other languages in Europe too.  Also, I've got a modify button and so have you.  Please use it instead of serial posting :).  Posts merged - Iris.
Title: Re: Alerts Help
Post by: Arantor on June 09, 2022, 04:49:06 PM
Quote from: FrizzleFried on June 09, 2022, 04:43:44 PMby design it seems.

Yes, I suck and will be leaving now. I was willing to invest in improving this but clearly the time and energy was a waste all round.
Title: Re: Alerts Help
Post by: FrizzleFried on June 09, 2022, 04:55:41 PM
Quote from: Arantor on June 09, 2022, 04:49:06 PM
Quote from: FrizzleFried on June 09, 2022, 04:43:44 PMby design it seems.

Yes, I suck and will be leaving now. I was willing to invest in improving this but clearly the time and energy was a waste all round.

Arantor... I think you know me a little better than that... and you know I'm not intending to offend.  My apologies for doing so.  Please see my above edit.  Walking away now.

EDIT: Walking back to clarify... when I said "Sorry... the behavior (obviously due to tech issues it seems) just sucks... by design it seems." I was referring to the fact that it appears the code was designed with the potential of very large forums thereby restricting the options on the table... hence the "obviously due to tech issues" portion of my comment.

I could have worded many of my responses today better.  Mind you... my position has not changed ... i certainly could have been a little more diplomatic in my expression for sure.  To be 100% honest... it was Kindred's response which I had the foresight of predicting (It's just... broke but I am sure there will be plenty here that will chime in telling me how wonderfully it works... ) ... that riled me up a bit more than it should have.  I really need a beer... but being that I've not had a taste of alcohol in nearly 3 years,  that's likely not going to happen today.

Anyway,  again,  I apologize Arantor.
Title: Re: Alerts Help
Post by: Kindred on June 09, 2022, 07:50:08 PM
I repeat... alerts are not broken in the core product. They might not work exactly like some people want them to work, but they work as intended.

What you are seeing is either limited to your site or limited by your misunderstanding.

Your continued declaration that things are broken is tiresome.
Title: Re: Alerts Help
Post by: Arantor on June 09, 2022, 07:56:08 PM
Quote from: Kindred on June 09, 2022, 07:50:08 PMbut they work as intended

Sorry, no, they don't. I believe I am qualified to make that statement.

Also, wish I'd never fought for their inclusion or implemented the system. I now believe 2.1 would have been better if literally none of my changes had been implemented, but that's another story.
Title: Re: Alerts Help
Post by: FrizzleFried on June 09, 2022, 07:58:03 PM
Quote from: Kindred on June 09, 2022, 07:50:08 PMI repeat... alerts are not broken in the core product. They might not work exactly like some people want them to work, but they work as intended.

What you are seeing is either limited to your site or limited by your misunderstanding.

Your continued declaration that things are broken is tiresome.

I disagree that they work "right".  They may work as intended,  but as intended is not "right". 

Sorry.  This duck doesn't chirp. 

EDIT: Seriously... where is that snickers? 

Look... I guess "right" is in the eye of the beholder.  To me... there is never a time where an alert should just pop up randomly... let alone a dozen or a hundred... it just makes the entire system seem... untrustworthy.

If you get an alert,  you should get that alert... in a timely fashion.  Not next week.  Not next month.  Not in a group of 20 all at one time.

If that happens.. the system seems... broken.  To me.  To my users.  But not to Kindred.

Got it.
Title: Re: Alerts Help
Post by: Darkness7148 on June 10, 2022, 11:28:34 AM
I have to agree. There are some serious issues with the alerts. I still haven't got any on this forum for weeks even though when I go to the Alerts page, it's packed full of new alerts. The number just doesn't seem to reflect properly.
Title: Re: Alerts Help
Post by: Diego Andrés on June 10, 2022, 12:32:03 PM
Here I get a few every morning even if I have more, but during the day I get none in the popup even if they are in the actual alerts page.
Title: Re: Alerts Help
Post by: voom on June 10, 2022, 12:32:33 PM
For me, it also still has not picked up as expected. As discussed in this thread, there was a mod leading to the cron jobs not running correctly. That was repaired. The cron runs every minute. Even when I am active in the board, alerts mostly come in bulk, and too late. Meaning: after I have already read the respective post etc. So: new alerts are not picked up every minute, and changed states of posts are not (always) detected when alerts are created.
Title: Re: Alerts Help
Post by: Diego Andrés on June 10, 2022, 12:35:44 PM
This actually has never happened to me before, so thought I'd share:

Screenshot_1.png
Title: Re: Alerts Help
Post by: FrizzleFried on June 10, 2022, 01:27:08 PM
Quote from: Diego Andrés on June 10, 2022, 12:35:44 PMThis actually has never happened to me before, so thought I'd share:

Screenshot_1.png

I've seen that.  That is normal.  You have to remember that alerts are not broken in the core product as indicated by the Support Lead for SMF.  Your issues are obviously with your servers (at your own sites) or maybe PEBCAK here at the official support site.



Title: Re: Alerts Help
Post by: FrizzleFried on June 10, 2022, 01:48:14 PM
For transparency purposes...

@Kindred

... exactly how many people have to complain about any particular "issue" with SMF before the team ... re-evaluates their current stance on that particular "issue"? 

Mind you,  I'm not declaring things are broken... on the contrary,  you've made it very clear (on more than one occasion) that the core product is NOT broken... I'm just curious as to how concrete that determination is?  "Is there any flexibility in regards to these things?",  I guess is the ultimate question...
Title: Re: Alerts Help
Post by: Arantor on June 10, 2022, 01:55:02 PM
I've seen it too, I can even give you theories as to why it is so. Very easy to produce if you use multiple tabs.

You know what's funny? Other systems at the time *behaved similarly*. Solutions involving message buses to update such things across tabs weren't really a concept 10 years ago because opening 5 tabs generated 5x the traffic to the server so we didn't (because we didn't have things like localStorage to share between tabs)

Now, if we'd released this in 2013 when it was written, this wouldn't be nearly so bad as it is today because everyone's expectations moved.

I reiterate that I wish I'd never built this thing at this point.
Title: Re: Alerts Help
Post by: voom on June 10, 2022, 02:12:54 PM
To make my last statement more specific: Likes e.G. are alerted almost instantly, it is only alerts to show that there is an answer to a post etc. that come belated and in bulks. Sometimes more than other times.
Title: Re: Alerts Help
Post by: Darkness7148 on June 11, 2022, 01:58:47 PM
Funnily enough since my reply, I now have 32 alerts in the bar.

I do love the concept of the Alerts. It is really useful on my forum for seeing posts that are relevant to you. But there does seem to be issues with it not updating sometimes.
Title: Re: Alerts Help
Post by: FrizzleFried on June 12, 2022, 10:56:02 AM
I figured I would come in and report more "intended behavior" of this system.


I came to this site.  I had an alert.  I clicked on it and it took me to the post in question.  Someone had quoted me.  Great! 

Next,  I click on UNREAD POSTS and I notice that the Alerts drop down up top still showed (1).  I click on the drop down and it's empty (at which point the 1 did disappear)...

Is this another example of 'intended behavior' for the Alerts system or is there an issue @Kindred ?

Actually... I think we should establish exactly what the INTENDED PURPOSE of the Alerts system is from the SMF Team's perspective.

Does the SMF Team consider the alerts system a useful tool or does the SMF Team consider the alerts system a fun novelty?  The current status of the alerts system sort of depends on what the teams perspective of the system is.

If the SMF Team considers the Alerts system a fun novelty,  I would agree with @Kindred ... it works as intended ... works well enough ... etc.

If the SMF Team consider the Alerts system a "useful tool" (which is my perspective).  It's simply broken in it's current form and no amount of arguing can change that fact.  So can we at least clarify where the SMF Team stands on this so I can either (A) continue pointing out the deficiencies of the "tool" in an effort that perhaps the SMF Team will improve it or (B) I can see if I can find SOMEONE to perhaps improve the system to bring it from "a fun novelty" to "a useful tool" status... (thereby giving the SMF Team guys a break on this.)

This "tool" is somewhat important to my users and I...  enough so that I paid for a similar "tool" for 2.0.x.  I would do so again however the author of that mod has decided not to implement his version for 2.1.x because it's already part of the core product.  So yeah...this is somewhat of a "big deal" in the overall scheme of things when it comes to my forum.

Thanks.

EDIT: Oh,  and when I posted on my forum that I was going to "give up" on this cause... that the "SMF Team has made it clear that the current system works 'as intended'"... this was the first response...

QuoteWay to fold!

I don't fold... ever. ;)
Title: Re: Alerts Help
Post by: Arantor on June 12, 2022, 11:49:08 AM
I can't speak for the team, but I can speak as the person who designed this system originally.

The intent and design goals and thinking that lead to all of this:
* Alerts should tell you about things that have happened that you might be interested in, and thus should generate engagement.
* If an alert is about a post, say that it has been liked, and you have seen the post recently, the thinking was that you'd seen whatever it was you were alerted about and thus marking it read was a logical progression.
* The display of alerts was to show you things you hadn't seen yet and to focus on specifically the things you hadn't seen yet, with a way to go view the things you had previously seen.
* Alerts were always intended to be processed out of band; that is, an action that triggers an alert should not process that alert in the exact same page load, for the exact reason that existing mail notifications on a topic could sometimes break the posting of that topic because of it happening and taking too long, thus the introduction of the background queue.
* The queue processing occasionally being lumpy is not an intended goal, but an unfortunate side effect; during development it was intended that people would set up cron to run it once a minute to clear the queue ensuring they be processed reasonably promptly without affecting the user side too much in terms of making pages slow in a way users should see.
* There can be a mismatch between the number above the popup and the number of alerts; this is because the number above the popup is calculated as at the time the page is loaded, while the actual alerts *in* the popup is live. This was done as a consideration for performance to avoid putting additional strain on the server, especially as at the time cross-tab storage of information was not viable.
* Whatever the 'live notifications'/AJAX callback does every however many seconds is not part of my original design, I have no idea what it actually does, I have never enabled it. This may even be why I don't notice as many issues as other people because it functions closer to how I intended it and therefore what my own subconscious biases tell me it should be doing.

I believe that, on the surface, people would broadly agree with the *intent* and initial thinking of the above, without prior knowledge of what it would produce. Some of it was done out of guesswork about how things might work better given usage patterns and what would be realistically achievable on the servers SMF is usually installed on (which are lower-specced than things like XenForo or IPS usually get given)

I do believe that with hindsight some of this thinking was well-intentioned but incorrect, and I outlined my suggested replacement for this in this topic (https://www.simplemachines.org/community/index.php?topic=582510.0), namely not draining the popup on things being read (I believe the marking things read on reading them is acceptable, but them disappearing off the popup is not), and being smarter about the number actually on the popup.

The most damning thing of all, though, is to hide behind 'it's working as intended'. Now, sometimes this is a legitimate response to criticism; sometimes you design things and you have to pick a path and stick to it, with the view that you make some people happy and not others; you cannot please all of the people all of the time, and there *are* things that subjectively don't feel right to everyone. For these situations - and it's far from all of them - you can say 'working as intended' and this is legitimate. It's a cop-out, because you're saying 'good enough for me, I don't care about your needs' but it's at least not intellectually bankrupt.

Here, however, that's simply not the case. Is it working as designed? Questionably. HOWEVER: this does not address the bigger, more important question. Is it a good design? You can have things working exactly as designed, but if the design's crap, the design's crap and it doesn't *matter* if it's working as intended because if it's badly designed, how well executed it is doesn't change that. It might, at best, make a crap design less unpalatable.

As I said, I believe the theory behind the design, at the point in time when it was designed seemed like a good idea at the time. But you know what? We tried it in a real world scenario, it turns out it doesn't work as well as expected and it needs addressing. I've outlined a few thoughts, on reflection I'm going to add some more in a moment.
Title: Re: Alerts Help
Post by: FrizzleFried on June 22, 2022, 10:15:33 AM
Arantor ... this post isn't intended for you ... but rather for the 'team'.  You get it.  Based on the responses above from @Kindred ... they don't... and while I am likely just kicking a dead horse... I do need the exercise.

OK... I was here PLENTY of times yesterday.  Throughout the day.

No alerts.  At all.

This morning.  I pop in.  And low and behold... i have 8 alerts (indicated in the drop down section).  I click on the drop down and it shows 5 of them only.  I click ALL ALERTS and this is what I am presented with:

ScreenHunter 506.jpg

As you can see... there are 5 UNREAD Alerts and 3 READ alerts there.

At the risk of invoking the ire of the SMF Team... i'll refrain from calling it "broken" ... but it certainly isn't "working correctly"... by any stretch.  Maybe one day the team will acknowledge the fact and I can stop posting examples of the system "working as intended".

EDIT: Oh,  and suddenly the alerts now show (5) in the drop down (the correct number if you ignore I never got the 3 alerts that I finally got this morning that were already read...) once I accessed that page... FWIW.

EDIT #2: Oh,  and to be crystal clear @Kindred ... this report is for THIS site... not my own server... not my own install... no "manual edits" of mine... etc...
Title: Re: Alerts Help
Post by: shawnb61 on June 25, 2022, 11:41:29 PM
The issue where the alert counter & popup got knocked out of sync with the alerts, as shown in FF's last post above, is confirmed as a bug.

PR submitted: https://github.com/SimpleMachines/SMF/pull/7510
Title: Re: Alerts Help
Post by: FrizzleFried on June 27, 2022, 12:52:46 PM
Thank you Shawn...