Skip to content

Broken CacheFlushing event on TaggedCache #55322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Cellard opened this issue Apr 8, 2025 · 6 comments · Fixed by #55405
Closed

Broken CacheFlushing event on TaggedCache #55322

Cellard opened this issue Apr 8, 2025 · 6 comments · Fixed by #55405

Comments

@Cellard
Copy link

Cellard commented Apr 8, 2025

Laravel Version

12.7.2

PHP Version

8.3

Database Driver & Version

no matter

Description

Since #55142 was merged, the tagged cache can not be cleared.

Steps To Reproduce

flush method isn't broken. clear method is broken. But it is a part of Psr\SimpleCache\CacheInterface and should work ahead, I think.

Image

@parallels999
Copy link

There was a great fix for this

But Taylor closes it and said:

I'm not sure what problem we are trying to solve here.

@AndrewMast
Copy link
Contributor

AndrewMast commented Apr 8, 2025

@parallels999 Don't ping like that. Especially not Taylor.

@AndrewMast
Copy link
Contributor

AndrewMast commented Apr 8, 2025

There was an attempt to fix this (#55223), but it was reverted since Taylor said he doesn't think the same event should be used for the whole cache as well as the tagged cache.

Edit: Nevermind, that wouldn't have fixed this issue.

@parallels999
Copy link

parallels999 commented Apr 8, 2025

#55223 wasn't trying to correct this, It was an attempt to just add the missing event

Your PR add setTags, that is the fix

/**
* Fire an event for this cache instance.
*
* @param \Illuminate\Cache\Events\CacheEvent $event
* @return void
*/
protected function event($event)
{
parent::event($event->setTags($this->tags->getNames()));
}

event expects \Illuminate\Cache\Events\CacheEvent instances but gets \Illuminate\Cache\Events\CacheFlushing without setTags method

EDIT:

Edit: Nevermind, that wouldn't have fixed this issue.

yes

@fredsal
Copy link

fredsal commented Apr 8, 2025

After version update i have the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants