Closed
Description
Symfony version(s) affected: 4.4.11+
Description
Its related to #37667
I actually stumbled upon another issue with the TagAwareAdapter
.
When we wrap an adapter into a ProxyAdapter
and use that as the tagsPool
then items are not invalidated.
How to reproduce
public function testClearsCacheProperly(): void
{
$arrayAdapter = new \Symfony\Component\Cache\Adapter\ArrayAdapter();
$adapter = new \Symfony\Component\Cache\Adapter\TagAwareAdapter(
$arrayAdapter,
new \Symfony\Component\Cache\Adapter\ProxyAdapter($arrayAdapter, 'some_namespace')
);
$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());
}
Additional context
I guess it might also be caused by #37562
ping @philipp-kolesnikov any chance you can help out here?