Use default configuration for properties that are not configured using remote configuration (close #613) #614
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.
Issue #613
The goal of this PR is to make the fetched or cached remote configuration use properties from the default configuration in case they are not overriden. For example, if the default config sets the
appId
in tracker configuration, but the fetched remote configuration doesn't change it, we should still use the app ID from the default configuraiton.To achieve this, I decided to remove the configuration update classes. Before, each configuration had a corresponding update class (e.g.,
TrackerConfigurationUpdate
) which purpose was to keep track of changes made to the configuration after the tracker was initialized. It remembered which properties were changed and made sure that changes are kept even if the configuration is replaced from the remote endpoint.Instead of the update classes, I moved the logic to check for the changes directly into the configuration classes. So the
TrackerConfiguration
class now has the ability to have asourceConfig
tracker configuration and when a property is requested, first it is checked if it is available in the current tracker configuration and, if not, it is retrieved from thesourceConfig
(this is exactly what the update class was doing before).Having the logic directly in the configuration classes, makes it possible to have multiple levels of the configurations. In particular, we now have the following levels:
ServiceProvider
has the top-most configuration. Properties of this are prioritized, but if they are not set, we go to the second level.All these changes are internal and should not change the public API.