Invalidate config_patch cache tag just once per request

Created on 3 November 2023, 8 months ago

Problem/Motivation

I found a problem with cache tag invalidation when trying to install the Fastly module. In src/EventSubscriber/ConfigSubscriber.php::onConfigChange() we invalidate the `config_patch` cache tag every time the config changes. However, I believe it should be sufficient to invalidate this tag just once per request.

When trying to enable Fastly, it has a listener that is opposite to this one, basically setting a config whenever a tag is invalidated, thus creating an infinite loop of config change -> tag invalidation -> config change -> tag invalidation -> etc.

Steps to reproduce

1. Install config_patch
2. Write any code that changes config on tag invalidation (or install https://www.drupal.org/project/fastly β†’ ).

Proposed resolution

Put a flag in the event subscriber, making sure to only invalidate once per request.

Remaining tasks

I will attach a patch.

User interface changes

-

API changes

-

Data model changes

-

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡·πŸ‡΄Romania alex.stanciu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024