Skip to content
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

[6.x] Fix bug with wildcard caching in event dispatcher #31313

Merged
merged 1 commit into from
Jan 31, 2020

Conversation

driesvints
Copy link
Member

    Event::listen('foo', fn () => dump('foo listener'));
    Event::listen('foo*', fn () => dump('foo* listener'));
    Event::dispatch('foo');

    Event::forget('foo');
    Event::forget('foo*');
    Event::dispatch('foo');

The above code would still execute the foo* listener because it will still be cached. We'll need to clear the cache when we forget the given (wildcard) key.

Fixes #31307

@taylorotwell taylorotwell merged commit 8bc60ef into 6.x Jan 31, 2020
@driesvints driesvints deleted the fix-wildcard-clearing branch January 31, 2020 16:17
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 this pull request may close these issues.

Wildcard listener still called after Event::forget('foo*')
2 participants