Skip to content

Skip empty queue entries, and test what the review found missing - #1197

Merged
frenck merged 2 commits into
mainfrom
frenck/review-test-gaps
Oct 3, 2026
Merged

frenck merged 2 commits into
mainfrom
frenck/review-test-gaps

Conversation

@frenck

@frenck frenck commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Proposed Changes

(Describe the changes and rationale behind them)

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 with notification.get("id"). For a null entry that raised an AttributeError, 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:

  • An endpoint skipping the parse helper, and leaking raw parsing errors again. There is now one test per endpoint.
  • The cloud catching only missing fields, letting invalid values escape.
  • A Wi-Fi block that is not an object, when the type check in device() gets loosened.
  • Broken JSON raised as a subclass like LaMetricAuthenticationError, which would make Home Assistant ask for new credentials.
  • Socket errors other than DNS when opening a stream.
  • An invalid height on a stream area.
  • Update missing from the package exports.

Related Issues

(Github link to related issues or pull requests)

None.

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.
@frenck frenck added the bugfix Inconsistencies or issues which will cause a problem for users or implementers. label Oct 3, 2026
@frenck
frenck merged commit a28ca40 into main Oct 3, 2026
31 checks passed
@frenck
frenck deleted the frenck/review-test-gaps branch October 3, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Inconsistencies or issues which will cause a problem for users or implementers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant