I am using this module (which I love, BTW!) on a Drupal 9.2.10 install (PHP 7.4.26 ) and I have noticed an issue.

Scheduled alerts don't seem to either appear or disappear automatically. I have observed that I have to open and re-save an alert (no need to make any changes) and then it works. It seems that I have to do this either after the start time to get the alert to appear, or after the end time to get it to disappear. I have been careful to double check the times I am using (including am/pm designations) as well as the system's time zone to rule out any use or system errors.

I have tested this with the latest Chrome and Safari browsers and my experience has been the same.

Please let me know if you would like any more information. Manual alerts work perfectly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

robert_t_taylor created an issue. See original summary.

ChrisSnyder’s picture

Robert, I have a couple of questions that may help me reproduce your issue and understand what is going on.

  1. Do the scheduled alerts eventually show within 60 seconds of their scheduled time?
  2. What is your "Browser and proxy cache maximum age" setting, found on /admin/config/development/performance ?
  3. Does this issue happen for both anonymous and authenticated, logged in, users?
  4. Is the "Automatically Update (Refresh) Alerts" setting turned on? And if so, what is the "Browser Refresh Interval (in seconds)" setting set to? These settings are found on /admin/config/sitewide_alerts .
  5. Are you leveraging any caching modules, like redis or memcache? If so which ones?
  6. Is the site experiencing this issue behind any reverse proxy or CDN (e.g., Varnish, CloudFlare, Nginx) that may be configured to cache responses? If so, are you able to test to see if this occurs when bypassing the proxy/CDN or occurs in your local development environment, if you have one?
robert_t_taylor’s picture

Thanks for the quick response. I'll answer each question in turn:

  1. Tested again. Oddly, it appears to only work if I reopen and save the alert after the timestamp in question (start or end).
  2. I currently have it set to no caching.
  3. It happens whether authenticated or anonymous.
  4. Yes, and it is set to refresh in 15 seconds
  5. We haven't configured any caching modules yet.
  6. We aren't using any reverse proxy or CDN.
ChrisSnyder’s picture

Robert, can you try to set the "Browser and proxy cache maximum age" setting, found on /admin/config/development/performance to 1 minute and confirm if the issue is still happening? This will help confirm if you are having the same issue as #3189144: Scheduling fails with Drupal page cache and cache.page.max_age set to 0

robert_t_taylor’s picture

OK, that seems to work correctly for me now. Another mentioned that it seems to take longer on mobile (Android and iPhone). I am going to try a bit more testing.

Thanks for your responsiveness!

robert_t_taylor’s picture

After a bit more testing, it looks like it is still acting a bit wonky.

I set an alert (warning) to appear at 8:58 am today and expire at 9:03 am today. While it did appear at the scheduled time, it is still rendering on desktop and mobile. Reloading the page does not help.

Some observations this morning. In Chrome Inspector's Network tab I can see the Cache-Control: max-age=60 header when I load the page. When "load" fires (init.js) I see the Cache-Control: max-age=15 header. However, if I view the response the expired alert is still present in the JSON payload and each time "load" fires it remains.

ChrisSnyder’s picture

I have been digging into your issue and have not found a definitive cause. I have a suspicion that there is an off-by-one issue when checking the expiration time. Can you apply the following patch and see if this corrects your issue?

SocialNicheGuru’s picture

Status: Active » Needs review
robert_t_taylor’s picture

Hey, ChrisSnyder, sorry for the delay in providing feedback on this issue. I believe off-by-one was the issue. I have tested this patch successfully on desktop and mobile (Chrome and Safari) and had a coworker test for me as well.

Thanks for hanging in there with me; much appreciated.

  • ChrisSnyder committed ef8fe9a on 2.x
    Issue #3263520 by ChrisSnyder, robert_t_taylor: Scheduled alerts not...
ChrisSnyder’s picture

Status: Needs review » Reviewed & tested by the community
ChrisSnyder’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.