-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - fix re-adding a plugin to a plugin group #2039
Conversation
c110e48
to
a2fa954
Compare
I'm curious, is this the best behavior here? Edit: I could be wrong, and there could be a valid use case, I just can't personally think of one. 😅 |
The error can happen when re-adding a plugin with a new configuration. To do that you would do: App::build()
.add_plugin_group_with(PluginGroup, |group| {
group.disable::<PluginA>()
.add_after::< PluginA, _>(PluginA {
// custom values here
})
}) but that didn't work before this PR: it marked |
Maybe it could issue a warning when replacing a pluging that is not disabled? |
I'm in favor of this behavior if possible. |
added a |
2495686
to
891cef0
Compare
891cef0
to
3cb9b4f
Compare
3cb9b4f
to
405f5a3
Compare
5c6ab13
to
9cd8d0f
Compare
9cd8d0f
to
5250fac
Compare
5250fac
to
86368c4
Compare
86368c4
to
ead2b23
Compare
Co-Authored-By: Niklas Eicker <git@nikl.me>
ead2b23
to
ebe230e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
In a `PluginGroupBuilder`, when adding a plugin that was already in the group (potentially disabled), it was then added twice to the app builder when calling `finish`. As the plugin is kept in an `HashMap`, it is not possible to have the same plugins twice with different configuration. This PR updates the order of the plugin group so that each plugin is present only once. Co-authored-by: François <8672791+mockersf@users.noreply.github.com>
In a `PluginGroupBuilder`, when adding a plugin that was already in the group (potentially disabled), it was then added twice to the app builder when calling `finish`. As the plugin is kept in an `HashMap`, it is not possible to have the same plugins twice with different configuration. This PR updates the order of the plugin group so that each plugin is present only once. Co-authored-by: François <8672791+mockersf@users.noreply.github.com>
In a `PluginGroupBuilder`, when adding a plugin that was already in the group (potentially disabled), it was then added twice to the app builder when calling `finish`. As the plugin is kept in an `HashMap`, it is not possible to have the same plugins twice with different configuration. This PR updates the order of the plugin group so that each plugin is present only once. Co-authored-by: François <8672791+mockersf@users.noreply.github.com>
In a `PluginGroupBuilder`, when adding a plugin that was already in the group (potentially disabled), it was then added twice to the app builder when calling `finish`. As the plugin is kept in an `HashMap`, it is not possible to have the same plugins twice with different configuration. This PR updates the order of the plugin group so that each plugin is present only once. Co-authored-by: François <8672791+mockersf@users.noreply.github.com>
In a
PluginGroupBuilder
, when adding a plugin that was already in the group (potentially disabled), it was then added twice to the app builder when callingfinish
. As the plugin is kept in anHashMap
, it is not possible to have the same plugins twice with different configuration.This PR updates the order of the plugin group so that each plugin is present only once.