fix(hue): Various nil index crashes for "stale" devices #1879
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.
Check all that apply
Type of Change
Checklist
Description of Change
The recent release that un-stuck the onboarding of multi-component devices has revealed that there are several setups on the platform where users have "stale" multi-component devices in their inventories. These devices appear to no longer be joined to the Hue Bridge topology (perhaps they were deleted then re-onboarded), but have not been deleted from the Edge Driver. We're not sure what causes this yet, but we have seen it happen rarely. These crashes can impede proper driver functionality, as well as preventing cleanup code that could fix the inconsistent state from executing.
It's unclear how hubs ended up in this state, and it is difficult to reproduce. So this PR avoids crashing the driver when devices are in this state, so that the driver or the user will at least have some opportunity to attempt cleanup.
Summary of Completed Tests