Closed (fixed)
Project:
Sitewide Alert
Version:
8.x-1.4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Jun 2020 at 19:33 UTC
Updated:
24 Nov 2020 at 20:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
ntaylor1994 commentedComment #3
chrissnyderCan you confirm that you are using version 1.3? As there was a fix that included in 1.3 for scheduled alerts.
In addition, do you have any other caching plugins or frontend caches you are using (varnish, Nginx, etc)?
Comment #4
ntaylor1994 commentedI can confirm 1.3 version, it's on my local environment so no varnish or anything.
I need to time it for, lets say 11:00am - 11:10am.
at 11:01am, I notice it's not showing up. So I run a drush cr. About halfway through the drush cr, the site alert shows up. (So the ajax is working)
Same for after 11:10am. It's still there, I clear drupal cache, and it goes away.
Comment #5
ntaylor1994 commentedUPDATE:
When I remain logged in, the site alert will appear, and stay when I log out. The problem is when I set the timed alert then log out before that time, I need to clear cache in order to see it.
Comment #6
ntaylor1994 commentedAnd for removing it, if it's passed the time, if I log in, the site alert will disappear to authenticated users, but not to the public. To me, it has sometime to do with like caching or permissions. Anonymous users will still see the alert if an authenticated user has not logged in and cleared cache once the alert is scheduled to come down, or someone runs drush cr command.
Comment #7
chrissnyderI believe this issue is related to https://www.drupal.org/docs/drupal-apis/cache-api/cache-max-age#s-limita...
Comment #8
chrissnyderI have added additional information to the response to allow Drupal's page cache to invalidate the alerts in the cache when the next scheduled alert is due to be removed as Drupal core's Page Cache module does not respect the max age on the response header.
Comment #10
chrissnyderComment #11
chrissnyderNote... if using redis as a cache backend, there may still be an issue. This may be related https://www.drupal.org/project/redis/issues/2877893 I am investigating.
Comment #12
chrissnyderComment #13
chrissnyderPatching the redis module with the patch from this comment corrected the issue when using Redis as the cache backend.
Comment #14
chrissnyderAdditional patch to account for scheduled alerts that are not yet visible. This patch was made against the 1.4 version
Comment #16
chrissnyderComment #17
chrissnyderComment #19
chrissnyderAdditional patch to account for feedback from @bradleyfmash. See https://git.drupalcode.org/project/sitewide_alert/-/commit/05fa05206b46c...
Comment #21
chrissnyderThe latest changes have been made to the 8.x-1.x (dev) branch.
Comment #22
chrissnyder