Repository navigation
grok fixes to avoid having a null config object on services. - #1447
Merged
Merged
Conversation
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.
this addresses the null config exception that was seen in 1.1.1615. Grok's assessment here:
`The InMoov2 panel calls i01.getPeerConfig("opencv") as soon as it opens. That reached OpenCV.getConfig() while config was still null, and the assignment config.capturing = capturing threw.
config starts null and is only set in apply(). The service is registered in the constructor, before apply() runs, and getPeerConfig treated “registered” as “has a config” and called getConfig() on it. A failed or missing apply() — including apply(null) — left that field null.
What changed:
Each service now gets a blank typed config before it is registered. apply() replaces that with the saved config and is what marks the config as ready.
getPeerConfig uses the live service only after apply() has succeeded. Otherwise it reads i01.opencv.yml, then the OpenCV default. If the peer is already running without an applied config, that saved config is applied onto it.
OpenCV.getConfig() returns null when config is null, and apply(null) no longer clears an existing config. The same null guard is on servo and speech getConfig(), which write fields the same way.
OpenCVConfigNullTest and ConfigTest both passed.`