See \Drupal\search_api\Controller\TaskController::executeTasksAccess(). Due to #2722237: "Local actions" block doesn't take cache data of route access information into account we had to set the cache max-age to 0 previously, but once we can rely on that fix in Drupal 8.7 (or 8.6.2, really – but I don’t think we want to start depending on patch versions), we should be able to change that to make the access check properly cacheable.

Comments

drunken monkey created an issue. See original summary.

drunken monkey’s picture

Title: Use the "search_api_task_list" cache tag for the local task access result » Use the "search_api_task_list" cache tag for the "Execute pending tasks" local action access check
drunken monkey’s picture

Issue summary: View changes

OK, the fix would be in 8.6.2 (or 8.6.3? The next non-security release, in any case.) already, too – but I don’t think that will matter to us.

drunken monkey’s picture

Issue tags: +Amsterdam2019
stefvanlooveren’s picture

Assigned: Unassigned » stefvanlooveren
stefvanlooveren’s picture

Assigned: stefvanlooveren » Unassigned
Status: Postponed » Needs review
StatusFileSize
new1.59 KB
stefvanlooveren’s picture

Last file should have proper line endings (unix)

drunken monkey’s picture

Thanks a lot for the patch! And also for re-posting with correct line endings – also something new learned, for both of us, I guess. ;)
Unfortunately, the patch is not quite complete like this: for the correct behavior we need to set the same cache metadata for both forbidden and allowed access results – see the attached patch.
I’m also uploading a debugging patch that just removes the metadata completely, to make sure that this correctly fails our test suite. (Otherwise, we would also need test coverage for this.)

drunken monkey’s picture

Status: Needs review » Postponed

OK, the test bot likes this and a manual test just now also confirmed that this is working fine.
Setting back to “Postponed”, to be committed once we depend on 8.7.

drunken monkey’s picture

Status: Postponed » Needs review
StatusFileSize
new3.56 KB
new4.41 KB
new4.41 KB

OK, “likes this” was wrong, of course, as I actually wanted the debug patch to fail.
Well, seems we need a new test for this after all. Let’s see …

drunken monkey’s picture

Status: Needs review » Fixed

Would have been nice to get another test/review, but as this has proper test coverage now, I think we can be fairly confident it works as intended.
So: committed.
Thanks again for your help on this!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.