Skip to content

[Cache] TagAwareAdapter not invalidating items properly since 4.4.11 #37667

@dmaicher

Description

@dmaicher

Symfony version(s) affected: 4.4.11

Description
After upgrading from 4.4.10 to 4.4.11 I noticed some failing tests on my project. After some debugging it seems that the TagAwareAdapter is not properly invalidating cache items by tag anymore.

How to reproduce
Minimal reproducing test case:

    public function testClearsCacheProperly(): void
    {
        $adapter = new \Symfony\Component\Cache\Adapter\TagAwareAdapter(
            new \Symfony\Component\Cache\Adapter\ArrayAdapter()
        );
        $item = $adapter->getItem('foo');

        $this->assertFalse($item->isHit());

        $item->tag('bar');
        $item->expiresAfter(100);
        $adapter->save($item);

        $this->assertTrue($adapter->getItem('foo')->isHit());

        $adapter->invalidateTags(['bar']);

        // this fails on 4.4.11 and passes on 4.4.10
        $this->assertFalse($adapter->getItem('foo')->isHit());
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy