Repository navigation
Skip empty queue entries, and test what the review found missing - #1197
Merged
Merged
Conversation
An empty entry in the notification queue made the warning about it crash, taking every valid notification in the queue down with it. A review of the recent changes also found regressions the tests would not have caught. Each now has a test that fails when it happens: endpoints that skip the parse helper, catching only missing fields in the cloud, a Wi-Fi block that is not an object, broken JSON raised as the wrong kind of error, socket errors other than DNS on the stream, an invalid height on a stream area, and Update missing from the package.
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.
Proposed Changes
Found in a review of everything that changed since v1.4.1.
An empty entry in the notification queue broke the whole queue.
notification_queue()skips notifications it cannot parse, but its warning read the ID withnotification.get("id"). For anullentry that raised anAttributeError, taking every valid notification down with it. The warning now only reads the ID from an object.Test gaps. The review tried plausible regressions against the recent changes, and these all slipped through the tests. Each now has a test that fails when it happens, verified by making each regression by hand:
device()gets loosened.LaMetricAuthenticationError, which would make Home Assistant ask for new credentials.Updatemissing from the package exports.Related Issues
None.