News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Timeout for Alert

Started by Bigguy, September 08, 2018, 08:05:38 PM

Previous topic - Next topic

Bigguy

What does this setting mean in 2.1 under notifications in your profile.

Timeout for Alert desktop notifications

Is this in minutes or seconds or days, lol.

Bigguy

So no one can understand this or ....???

feline

Number of calls the cron.php ...

Bigguy


shawnb61

Pretty sure it's in seconds.  Should probably be labeled more clearly. 

Note in Sub.php it gets multiplied by 1000 before passing to .js.

In alerts.js it's passed to setTimeout, which expects ms. 

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Bigguy

SO than you want it set to zero ???

shawnb61

I am not familiar with that code, but I doubt that you want it set to 0. 

The .js timeout feature helps you avoid having .js scripts stepping on themselves, because they take time to execute.  Or avoiding scripts from running too frequently.  Too low a value would likely waste CPU on stupid stuff - looking for nothing.  It might even cause a nasty performance issue. 

I suspect this is one of those examples where having NO setting would have been better...   Just set it to 10 seconds and nobody would have known the difference, and the app would have been nice & safe...

(Speculation alert...  I have not tested this feature...)
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Bigguy

I don't want an alert system that is going to notify me 10 min after a post is made. I thought the idea was to get notifications as soon as you wanted them. If this is set as you said than it would almost have to be set at zero to get notifications instantly, would it not. ???

Quote from: shawnb61 on September 11, 2018, 10:54:23 AM
Pretty sure it's in seconds.  Should probably be labeled more clearly. 

Note in Sub.php it gets multiplied by 1000 before passing to .js.

In alerts.js it's passed to setTimeout, which expects ms. 



shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

For the record, for the reasons specified above, it will *not* let you set the timeout to 0.   

Try it!    ;D

I found a sneaky workaround...   Set it to .000001.  It's not 0 so it's allowed.  But then it gets rounded to 0 and stored as 0.   

But the code in alerts.js tests for 0 and will not overwrite the 10 second default if you do so. 

And yes, it's a polling interval.  You really don't want a value of 0.  You'd be telling your browser that's the only thing you'd ever allow it to do.  But you do, in fact, want your browser to be able to do other things.  Like actually use the site in question. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Bigguy

Yeah i did try to set it to zero. I have it at one now. Maybe this should be explained under the button in the admin panel to make it clear to people how to use it. Maybe add one of those question marks beside it so there is a description for it.

Advertisement: