Skip to content

Conversation

@simonworkhouse
Copy link
Contributor

Fixes #53589

Booted callbacks which are added during the execution of other callbacks are being called twice, once as the callback is registered and again when the while loop reaches that callback in the stack.

This issue was introduced in version 8.65.0 by the commit 9eadb7f.

A number of different fixes were considered, but I believe that the best option would be to simply not append the callback and I would think that this is likely to be the least breaking change.

In determining this, I took into consideration the fact that some applications may have existing callbacks that check the booted state of the application, and I also considered the fact that the callback was already being called as soon as it was registered but now it simply is not called a second time.

Please let me know if you would also like a test written for this.

@taylorotwell
Copy link
Member

Huge change in behavior.

kingsven pushed a commit to simonworkhouse/laravel-framework that referenced this pull request Nov 28, 2024
Booted callbacks which are added during the execution of other callbacks
are being called twice. This commit is an alternative inmplementation of
a fix for this issue. Originial PR laravel#53683
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.

Application booted callbacks called twice

2 participants