Add warnings for if a plugin is inserted twice#4973
Closed
TheRawMeatball wants to merge 1 commit intobevyengine:mainfrom
Closed
Add warnings for if a plugin is inserted twice#4973TheRawMeatball wants to merge 1 commit intobevyengine:mainfrom
TheRawMeatball wants to merge 1 commit intobevyengine:mainfrom
Conversation
Sheepyhead
approved these changes
Jun 9, 2022
Contributor
|
I think that #3988 is better, as it either enforces that a plugin can only be used once or that a plugin explicitly says it can be used multiple times, instead of an unsuppressible warning like in this PR. |
Member
Author
|
Ah, I didn't know that PR existed. |
james7132
requested changes
Jun 9, 2022
| debug!("added plugin: {}", plugin.name()); | ||
| if !self | ||
| .world | ||
| .get_resource_or_insert_with(|| AddedPluginsRegistry(HashSet::new())) |
Member
There was a problem hiding this comment.
I'd prefer it if we could avoid adding Resources that don't get used at runtime, instead opting to either embed it into the App itself, or bring back the old AppBuilder to discard this state after app construction is finalized.
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
A plugin being inserted multiple times can cause very subtle bugs that are hard to track down
Solution
Issue a warning if the same plugin is ever inserted multiple times to make tracking down such bugs easier.