Fix ambiguous register_default_module order #102
Merged
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.
Fix ambiguous
register_default_module
orderAttention: This is a breaking change.
This MR implements a policy on the order of multiple realized
register_default_module
-calls.Description
Imagine, you register multiple default-modules: Each such calls checks for an event, and, if not registered, loads a given module and may overwrite its settings.
Setup:
Problem:
In case multiple such calls ask for the same event, the order has been unspecified until now.
In more detail, there are in-fact distinct orders of actions that need to be define in order to use this feature consistently.
module1
. Which settings should be used in casemodule1
has already been loaded?Previously:
module1
will be loaded).var1
would get the value1234
).New Behavior:
The previous solution is counter-intuitive, as a later call does not "overwrite" the choice of modules.
(For instance, imagine several such commands in a dependency chain. The most-recent call such define the module to be loaded.)
Thus, this MR changes the order in the following way:
module2
).var1
would get the value4321
).Check all before creating this PR: