Skip to content

[Cache] CacheItem with tag is never a hit after expired once #36458

@alexander-schranz

Description

@alexander-schranz

Symfony version(s) affected: 4.4.0 -> 4.4.7

Description

If a CacheItem with a Tag is expired once and be rewritten with a new expiredAfter it is never again a hit.

How to reproduce

#36457

Possible Solution

Can sadly not provide a solution as I'm not sure where the error is.

Additional context

Without tags it works as expected.

Also when using the older TagAwareAdapter( instead of the optimized FilesystemTagAwareAdapter it works as expected so it need to be in the TagAwareTraitAdapters as the following tests are effected:

1) Symfony\Component\Cache\Tests\Adapter\FilesystemTagAwareAdapterTest::testRefreshAfterExpires

Failed asserting that false is true.

/home/travis/build/symfony/symfony/src/Symfony/Component/Cache/Tests/Traits/TagAwareTestTrait.php:194

2) Symfony\Component\Cache\Tests\Adapter\PredisTagAwareClusterAdapterTest::testRefreshAfterExpires

Failed asserting that true is false.

/home/travis/build/symfony/symfony/src/Symfony/Component/Cache/Tests/Traits/TagAwareTestTrait.php:183

3) Symfony\Component\Cache\Tests\Adapter\RedisTagAwareAdapterTest::testRefreshAfterExpires

Failed asserting that true is false.

/home/travis/build/symfony/symfony/src/Symfony/Component/Cache/Tests/Traits/TagAwareTestTrait.php:183

4) Symfony\Component\Cache\Tests\Adapter\RedisTagAwareClusterAdapterTest::testRefreshAfterExpires

Failed asserting that true is false.

/home/travis/build/symfony/symfony/src/Symfony/Component/Cache/Tests/Traits/TagAwareTestTrait.php:183

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