Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleted service status updates only disappear from landing page after a cache rebuild #229

Closed
dedavidson opened this issue Nov 1, 2023 · 7 comments · Fixed by #234
Closed

Comments

@dedavidson
Copy link

I haven't been able to fully test this yet but I believe that modules/localgov_services_status/localgov_services_status.module should include an implementation of hook_ENTITY_TYPE_predelete() so that the landing page cache is invalidated when a status is deleted in same way as it is in the implementation of hook_ENTITY_TYPE_presave() when a status page is saved.

@ekes
Copy link
Member

ekes commented Nov 2, 2023

I've not looked at the logic of this very much, but am I correct that what you mean by the 'landing page' not being updated is the block on the 'service landingpage'?

If so looking at it

if (!$node->get('localgov_service_status_visibile')->isEmpty()) {
I'm wondering if all of the nodes iterated over there (they're the status' right?) should be included in the cache data so that any change to any of them invalidates the cache? @stephen-cox does that sound right?

Or if we don't mind all of the status blocks getting invalidated when new status' are posted node_list:localgov_service_status cache tag might even make that presave unnecessary?

@stephen-cox
Copy link
Member

So node_list:localgov_services_status cache tag is added to the block cache tags, so in theory any change to service status nodes should invalidate the cache for the block, but it's not working as expected. Adding all the individual cache tags seems to fix it though.

@rupertj
Copy link
Member

rupertj commented Jan 9, 2024

I've been testing the linked PR, and I can't recreate the original issue. (Although I have found a sort of related one...)

With either the 2.1.5 release, or the code in the PR, the behaviour is the same for me:

  1. Create a service landing page and view it.
  2. Create a service status, set to appear on the service landing page.
  3. View the service landing page again: status does not appear.
  4. Clear cache: status does appear
  5. Delete status node.
  6. View the service page again: status does not appear. No cache clear is required this time.

So for me, removing the status works with or without the code in the PR. Adding a new status does not.

@rupertj
Copy link
Member

rupertj commented Jan 10, 2024

And just to prove that this isn't my install being weird, I've added just the test change from PR #234, and not the code change to a separate PR: #239 . The Unit tests still pass.

@rupertj
Copy link
Member

rupertj commented Jan 11, 2024

@dedavidson Just to check, is your issue with the block, or the deprecated updates panel? See #129 for a screenshot of the panel.

@dedavidson
Copy link
Author

@rupertj it was the panel.

@stephen-cox
Copy link
Member

@rupertj This error can be reproduced on the https://test.localgovdrupal.org/ site.

I have deleted the 'Adult social care service is working normally' service status, but it still appears on this page: https://test.localgovdrupal.org/adult-health-and-social-care

image

If you're testing locally make sure all the caches are enabled; they're disabled in Lando by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants