Skip to content

v2.1.7#1120

Merged
bwp91 merged 14 commits into
latestfrom
beta-2.1.7
May 26, 2026
Merged

v2.1.7#1120
bwp91 merged 14 commits into
latestfrom
beta-2.1.7

Conversation

@bwp91

@bwp91 bwp91 commented May 24, 2026

Copy link
Copy Markdown
Contributor

Changes

  • chore: dependency updates
  • chore: drop local @types shims, use upstream bonjour-hap types
  • chore(ci): bump release workflow action versions
  • test: cover encrypted data length validation in pair handlers
  • test: cover required TLV field validation in pairing handlers
  • test: cover RTP proxy setup rejection handling
  • test: cover SEQUENCE_NUM presence check in pair handlers
  • test: cover M1 reset prevention in pair-setup
  • test: cover safe accessory lookups in slow/timeout warnings
  • test: cover aid.iid format validation
  • test: cover camera stream start TLV parsing guards
  • test: cover error argument in pairing debug logs
  • test: cover constant-time pincode comparison
  • test: cover characteristic warning message for non-Error throws

Homebridge Dependencies

  • @homebridge/ciao @ v1.3.9-beta
  • @homebridge/dbus-native @ v0.7.6-beta
  • bonjour-hap @ v3.10.3-beta

@bwp91
bwp91 requested a review from Copilot May 24, 2026 23:46
@bwp91 bwp91 self-assigned this May 24, 2026
@coveralls

coveralls commented May 24, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 26403229315

Coverage increased (+1.5%) to 66.09%

Details

  • Coverage increased (+1.5%) from the base build.
  • Patch coverage: 1 of 1 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 9464
Covered Lines: 6570
Line Coverage: 69.42%
Relevant Branches: 3364
Covered Branches: 1908
Branch Coverage: 56.72%
Branches in Coverage %: Yes
Coverage Strength: 220.11 hits per line

💛 - Coveralls

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the v2.1.7 release by updating dependencies, removing local type shims in favor of upstream typings (notably bonjour-hap), and adding a broad set of regression tests around pairing, request validation, and camera streaming error handling.

Changes:

  • Update Homebridge-related dependencies and various dev dependencies, plus refresh package-lock.json.
  • Drop local @types/bonjour-hap shims and adjust Advertiser typing to match upstream bonjour-hap exports.
  • Add multiple new/expanded Jest test suites covering previously fixed guards/edge cases in HAP server pairing handlers, accessory characteristic handling, and RTP stream management.

Reviewed changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/lib/HAPServer.spec.ts Adds extensive integration tests for pairing guards, TLV validation, debug logging args, and constant-time auth comparisons.
src/lib/Characteristic.spec.ts Adds tests ensuring “Unknown error” warning text for non-Error throws.
src/lib/camera/RTPStreamManagement.spec.ts New tests for malformed TLV handling in _handleStartStream and proxy setup rejection handling.
src/lib/Advertiser.ts Switches from local bonjour-hap shim types to upstream bonjour-hap types (Bonjour, Advertisement).
src/lib/Accessory.spec.ts Adds tests for malformed aid.iid event strings and safe lookups in slow/timeout warnings.
package.json Dependency and devDependency version bumps (incl. Homebridge beta packages).
package-lock.json Lockfile updated to reflect dependency bumps.
CHANGELOG.md Adds “v2.1.7 (Pending Release)” entry describing included changes and dependency versions.
@types/simple-plist.d.ts Removes unused/obsolete local type shim file.
@types/bonjour-hap.d.ts Removes local bonjour-hap type shim file.
.github/workflows/release.yml Bumps jannemattila/get-version-from-tag action from v3 to v4.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib/HAPServer.spec.ts
Comment thread src/lib/camera/RTPStreamManagement.spec.ts
Comment thread CHANGELOG.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 11 changed files in this pull request and generated 3 comments.

Comment thread src/lib/HAPServer.spec.ts
Comment thread CHANGELOG.md Outdated
Comment thread package.json Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 11 changed files in this pull request and generated 2 comments.

Comment thread package.json
Comment thread CHANGELOG.md Outdated
@bwp91
bwp91 requested a review from NorthernMan54 May 25, 2026 00:18
bwp91 and others added 14 commits May 25, 2026 14:34
Adds four HAPServer integration tests verifying the guard from
0719059: /pair-setup M5 and /pair-verify M3 must respond with M4 +
TLVErrorCode.AUTHENTICATION when ENCRYPTED_DATA is missing or shorter
than the 16-byte auth tag, rather than passing through to a Buffer.alloc
with a negative length.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds seven HAPServer integration tests verifying the guards from
58c24b9:
- /pair-setup M5 rejects when the decrypted sub-TLV is missing IDENTIFIER
- /pair-verify M3 rejects when the decrypted sub-TLV is missing PROOF
- /pairings rejects requests missing METHOD or STATE
- /pairings ADD_PAIRING rejects when IDENTIFIER or PUBLIC_KEY is missing
- /pairings REMOVE_PAIRING rejects when IDENTIFIER is missing

Without these guards the handlers would crash on a `Buffer.toString()` /
indexed access of an undefined TLV entry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds two RTPStreamManagement tests verifying the .catch handler from
0ce74c4: when RTPProxy.setup() rejects (e.g. socket bind failure),
handleSetupEndpoints must surface the error via the callback and write
SetupEndpointsStatus.ERROR into setupEndpointsResponse. Without the
catch this surfaced as an unhandled promise rejection.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds two HAPServer integration tests verifying the guard from
ebe2ec6: /pair-setup and /pair-verify must reject with 400
BAD_REQUEST + STATE=M2 + UNKNOWN error when the request TLV is
missing TLVValues.SEQUENCE_NUM, rather than crashing on an indexed
read of an undefined entry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds two HAPServer integration tests verifying the guard from
d4c81be:
- a second M1 on a connection with in-progress pair-setup state is
  rejected with 400 BAD_REQUEST + STATE=M2 + UNKNOWN, rather than
  restarting setup and overwriting the in-progress SRP server.
- a fresh connection can still start M1 normally — the guard does
  not leak across connections.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds two Accessory tests verifying the fix from 03b49f9: when a
GET /characteristics or PUT /characteristics request includes an
aid.iid that does not resolve to a known accessory or characteristic,
the slow-read/slow-write and timeout warning timers must skip the
entry rather than crash on `getAccessoryByAID(aid)!.getCharacteristicByIID(iid)!`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds tests verifying the guards from ec93c50:
- HAPServer GET /characteristics rejects malformed `?id=` entries
  (non-numeric, missing dot, too many dots, empty parts) with 400 +
  HAPStatus.INVALID_VALUE_IN_REQUEST, both for a single bad entry and
  inside a comma-separated list.
- Accessory.handleHAPConnectionClosed skips registered events that do
  not contain a dot separator, instead of feeding an undefined index
  to parseInt.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds two RTPStreamManagement tests verifying the try/catch from
3405658: when a /selected-stream-configuration write contains
malformed video/audio configuration TLVs (missing fields, undefined
buffer reads), `_handleStartStream` must call back with
HAPStatus.INVALID_VALUE_IN_REQUEST rather than throwing out of the
characteristic write handler.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds two HAPServer integration tests verifying the fix from f12ed23:
when M5 / pair-verify M3 decryption fails, the debug() call must
receive the caught error as its second %s argument. Tests intercept
the global debug.log function and assert the captured args include
the username AND the error object — without the fix only the
username was passed and %s rendered as a literal trailing
\"undefined\" / blank.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds five HAPServer tests verifying the fix from 12aea01: the
insecure PUT /characteristics and POST /resource paths must compare
the authorization header against the configured pincode using
crypto.timingSafeEqual with a length check first. Coverage:
- missing authorization → CONNECTION_AUTHORIZATION_REQUIRED
- wrong-length authorization → rejected (without the length guard
  timingSafeEqual would throw RangeError)
- same-length wrong pincode → rejected
- correct pincode → authorized
- /resource endpoint also rejects wrong-length auth

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds three Characteristic tests verifying the fix from fe8c1b3:
when validateUserInput throws an object without a `message` property
(e.g. a non-Error), setValue and updateValue must emit the
characteristic warning with the message "Unknown error" instead of
the literal string "undefined" produced by `error?.message + ""`.
A real Error message is still preserved untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 11 changed files in this pull request and generated 1 comment.

Comment thread package.json
@bwp91
bwp91 requested review from NorthernMan54 and removed request for NorthernMan54 May 25, 2026 14:13
@bwp91
bwp91 merged commit 1e5175f into latest May 26, 2026
24 checks passed
@bwp91
bwp91 deleted the beta-2.1.7 branch May 26, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants