Fix observers not removing themselves from ObservedBy.#24802
Open
andriyDev wants to merge 3 commits into
Open
Conversation
eb343f4 to
c75bacf
Compare
Zeophlite
approved these changes
Jun 29, 2026
mgi388
reviewed
Jun 29, 2026
| .spawn(Observer::new(|_: On<Hi>| {}).with_entities([target, target])) | ||
| .id(); | ||
|
|
||
| // This is likely not desirable, but preventing this is not worth it. |
Contributor
There was a problem hiding this comment.
doc nit: this comment confused me ("preventing" felt wrong and your use of "this" twice wasn't clear and I had to re-read the comment multiple times).
Should you just update the // Observe the same entity multiple times. comment to say:
// Observe the same entity multiple times. It's likely not desirable to do this, but disallowing it is not worth it, so lets check this case too.
Contributor
There was a problem hiding this comment.
I agree that the wording needs to change
I interpreted this differently as “It’s likely not desirable that ObservedBy contains the same observer entity multiple times"
Contributor
Author
There was a problem hiding this comment.
Done. I made it more clear!
mgi388
reviewed
Jun 29, 2026
kfc35
approved these changes
Jun 29, 2026
Contributor
|
adding waiting-on-author for some comment clarification in the test, but it looks good to me |
mgi388
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Objective
Solution
Testing