Problem/Motivation

While reviewing https://www.drupal.org/project/autologout/issues/3185506 I noticed that when updating the module settings they are not updated in drupalSettings JS variables on cached frontend pages.

Steps to reproduce

  1. Make sure that dynamic page cache is working correctly (X-Drupal-Dynamic-Cache header shows MISS/HIT)
  2. Login as an admin
  3. Visit your user profile page
  4. Open your browser console and inspect drupalSettings.autologout variables
  5. Go to /admin/config/people/autologout and update settings eg. increase timeout value
  6. Visit your user profile page again
  7. Inspect drupalSettings.autologout variables again and they are not updated

Proposed resolution

Add autologout settings cache tags to autologout_page_attachments hook so that the cache is invalidated when settings are updated.

Remaining tasks

  1. Add failing automated tests
  2. Add missing cache tags
  3. Make sure automated tests pass
  4. Review and commit

User interface changes

None

API changes

None

Data model changes

None

Issue fork autologout-3190324

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bcizej created an issue. See original summary.

bcizej’s picture

Issue summary: View changes
Status: Active » Needs work

Added a failing test.

bcizej’s picture

Issue summary: View changes
bcizej’s picture

Status: Needs work » Needs review
bcizej’s picture

Issue summary: View changes
deaom’s picture

Status: Needs review » Reviewed & tested by the community

Could reproduce the issue described when testing manually (automated tests were also failing with core 8.9.11). Tested manually locally with core 8.9.11 and it's also working as expected. So marking this issue as RTBC.

boshtian made their first commit to this issue’s fork.

  • boshtian committed 2100120 on 8.x-1.x authored by bcizej
    Issue #3190324 by bcizej, DeaOm: Settings are not updated on cached...
boshtian’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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