Problem/Motivation

If a view display is using the search_api_tag cache plugin, I'm expecting that display.{display}.cache_metadata.tags to contain also the search_api_list:{index} cache tag.

But the tag is missing.

Even SearchApiTagCache::getCacheTags() computes this tag, is never picked up in DisplayPluginBase::calculateCacheMetadata().

Steps to reproduce

* Create a view based on a Search API index.
* Set the cache plugin to Search API (tag-based)
* Save and export configuration
* Inspect the YAML file: the search_api_list:{index} is missing.

Proposed resolution

Make SearchApiTagCache implement CacheableDependencyInterface

Remaining tasks

None.

Issue fork search_api-3298295

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

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

Title: The search_api_list:{index} cache tag is not added to the view display » 3298295-search_api_list
Issue tags: +Needs tests

But not sure this is the solution. The tag has been added in the past but some changes made it disappear on view save

claudiu.cristea’s picture

Title: 3298295-search_api_list » The search_api_list:{index} cache tag is not added to the view display

Revert title

drunken monkey’s picture

Status: Active » Postponed (maintainer needs more info)

Thanks for reporting this problem, and sorry it took me a while to get back to you!
Can you still reproduce the problem with the latest dev version of the module? It seems to work fine for me. (Also, there have been some cache plugin fixes in the meantime.)
If you can still reproduce the problem, please tell me the Drupal version you’re using. Maybe that makes the difference. A failing test would of course be even better.

For working on a solution, please use patches, not issue forks/MRs, in this module, as the latter cannot be tested by the test bot for some reason. (See #3190024: Problem with test dependencies when testing issue forks.)

drunken monkey’s picture

Component: General code » Views integration
mxr576’s picture

@claudiu.cristea Could you provide more context on this issue? I wonder if #3327645: View recalculated with wrong data from cache will fix this also.

herved’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)
Related issues: +#3327645: View recalculated with wrong data from cache

Hello, I'm a colleague of @claudiu.cristea.
I checked our project and I can no longer reproduce this issue after removing this patch on latest search_api 8.x-1.40. It seems the fix for this was provided by #2905497: Views Integration - Consider compatibility with internal page cache, released in 2023 with search_api 8.x-1.29.

I'm therefore closing this as fixed, thank you all :)

PS: we also need #3327645: View recalculated with wrong data from cache which fixes a different issue so is also relevant and I see was recently committed to dev. So everything looks good to me.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.