[11.x] Fix issue where booted callbacks are being called twice #53683
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.