Fix experiment engine dynamic config load #214
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.
Bug
When a custom experiment engine's remote UI must be loaded, the current implementation of the
ExperimentEngineLoaderComponentloads the remote entry file first and then the dynamic config, if any, sequentially. If both succeed, the children of the component (which would attempt to load the specific remote components from the remote engine UI) will be returned. Intermittently, the config loader fails to be mounted with the following warning:As a result, the experiment engine's dynamic configs are not loaded which causes unexpected behaviours in the respective views - this can only be reset with a hard refresh. As an example, we see the below error with the turing-experiments engine, when viewing a router (the API host, which was supposed to have been retrieved from the dynamic configs is missing, and the dummy default value that's compiled into the UI build is taken).
Fix
The fix refactors the
ExperimentEngineLoaderComponentso that the remote entry file as well as the config file of the custom experiment engine will be loaded using the same parent component which is also responsible for returning thechildren- this fixes the warning (and the subsequent error) and also has the advantage of parallel retrieval of the script files.