Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes to recording logging and one change in logging. #1040

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

hjdhjd
Copy link
Contributor

@hjdhjd hjdhjd commented Jun 24, 2024

♻️ Current situation

Two fixes for logging:

  • A missing connection identifier in the debug logging of the close handler.
  • Message notifying users that isLast is missing used string literals with the message broken up over two lines for code formatting purposes. I've adjusted it to output as-intended on a single line.

Removed one log warning related to not sending any data out through the recording handler. There are valid situations where not sending out any data is the correct answer such as when the HomeKit hub specifically terminates the connection before the first recording packet is sent out. In that instance, sending any data back would result in a different error (Delegate yielded fragment after close). In truth, while this should be an edge case that rarely occurs, it does occur regularly enough that you'll see it in a typical home environment when you have more than a few cameras that are producing HomeKit Secure Video events.

💡 Proposed solution

See above.

⚙️ Release Notes

Minor logging improvements for HomeKit Secure Video recording delegates.

➕ Additional Information

If applicable, provide additional context in this section.

Testing

Which tests were added? Which existing tests were adapted/changed? Which situations are covered, and what edge cases are missing?

Reviewer Nudging

@donavanbecker @Supereg

console.warn(`[HDS ${this.connection.remoteAddress}] Delegate finished streaming for ${this.streamId} without setting RecordingPacket.isLast. \
Can't notify Controller about endOfStream!`);
console.warn(`[HDS ${this.connection.remoteAddress}] Delegate finished streaming for ${this.streamId} without setting RecordingPacket.isLast. ` +
"Can't notify Controller about endOfStream!");
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I do not like it this way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Current implementation produces:

[HDS ::ffff:1.2.3.4] Delegate finished streaming for 1 without setting RecordingPacket.isLast.         Can't notify Controller about endOfStream!

This is incorrect - having the error include spurious spaces where they are not needed nor appropriate is grammatically incorrect and confusing. 😄

The \ is the error.

The choices are to either violate code formatting consistency and have the line be unnaturally long, change the message to be shorter, or use two lines of code. I chose the option that preserved the message and preserved the source code formatting preferences.

If you've got a better recommendation that's consistent with the coding style / standards in HAP-NodeJS, I welcome it...sometimes you choose the best of suboptimal options, but if there's something missed, please provide an alternative that addresses the issue within the above constraints.

The code now more correctly produces:

[HDS ::ffff:1.2.3.4] Delegate finished streaming for 1 without setting RecordingPacket.isLast. Can't notify Controller about endOfStream!

Copy link
Contributor

Choose a reason for hiding this comment

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

Are we good to merge and get into v0.12.3?

@donavanbecker donavanbecker mentioned this pull request Jun 24, 2024
@donavanbecker donavanbecker merged commit 853171f into latest Jun 24, 2024
6 of 9 checks passed
@donavanbecker donavanbecker deleted the hjd-hksv-updates branch June 24, 2024 15:32
donavanbecker added a commit that referenced this pull request Jul 11, 2024
## v1.0.0 (2025-07-11)

### Breaking Changes

- **The minimum Node.js version required is now `v18`.**
- **Important notice:** Because of the cleanup of the Deprecated code, you will need to migrate you code base.
    - Remove the long-deprecated init().
    - Deprecate Core, BridgedCore, legacy Camera characteristics. (#1058) (@hjdhjd)
        - For deprecated `Core` and `BridgedCore` see: https://github.com/homebridge/HAP-NodeJS/wiki/Deprecation-of-Core-and-BridgeCore
    - Legacy code deprecation cleanup. (#1059) (@hjdhjd)
        - For deprecated `storagePath` switch to `HAPStorage.setCustomStoragePath`, `AudioCodec` switch to `AudioStreamingCodec`, `VideoCodec` switch to `H264CodecParameters`,`StreamAudioParams` switch to `AudioStreamingOptions`, `StreamVideoParams` switch to `VideoStreamingOptions`,`cameraSource` switch to `CameraController`.
    - Others deprecated code to highlight removed: `useLegacyAdvertiser`, `AccessoryLoader`,

### Fixed

- Fix: Build Issues (#1041) (@NorthernMan54)
- Fix: Ensure data is only transmitted on open and ready connections. (#1051) (@hjdhjd)
- Fix: Ensure we check names using the full UTF-8 character set. (#1052) (@hjdhjd)
- Fix: ConfiguredName (#1049) (@donavanbecker)
- Fix: Manufacturer looking at checkName but should look at checkValue. (#1053) (@donavanbecker)

### Other Changes

- Implement warning messages for invalid characters in names (#1009) (@NorthernMan54)
- Mitigate event emitter "memory leak" warnings when a significant number of camera streaming events occur simultaneously (#1037) (@hjdhjd)
- AdaptiveLightingController fix & improvement (#1038) (@Shaquu)
- Minor fixes to recording logging and one change in logging. (#1040) (@hjdhjd)
- Bridged core and core cleanup (#1048) (@Shaquu)
- Increase snapshot handler warning timeout to 8000ms. (#1055) (@hjdhjd)
- Cleanup and refactor getLocalNetworkInterface and address a potential edge case. (#1056) (@hjdhjd)
- Correct log spacing
- Updated and fixed `typedoc` config file
- Updated dependencies

### Homebridge Dependencies

- `@homebridge/ciao` @ `v1.3.0`
- `bonjour-hap` @ `v3.8.0`
donavanbecker added a commit that referenced this pull request Jul 11, 2024
- **The minimum Node.js version required is now `v18`.**
- **Important notice:** Because of the cleanup of the Deprecated code, you will need to migrate you code base.
    - Remove the long-deprecated init().
    - Deprecate Core, BridgedCore, legacy Camera characteristics. (#1058) (@hjdhjd)
        - For deprecated `Core` and `BridgedCore` see: https://github.com/homebridge/HAP-NodeJS/wiki/Deprecation-of-Core-and-BridgeCore
    - Legacy code deprecation cleanup. (#1059) (@hjdhjd)
        - For deprecated `storagePath` switch to `HAPStorage.setCustomStoragePath`, `AudioCodec` switch to `AudioStreamingCodec`, `VideoCodec` switch to `H264CodecParameters`,`StreamAudioParams` switch to `AudioStreamingOptions`, `StreamVideoParams` switch to `VideoStreamingOptions`,`cameraSource` switch to `CameraController`.
    - Others deprecated code to highlight removed: `useLegacyAdvertiser`, `AccessoryLoader`.
- Fix: Naming for Characteristic.ProgramMode has been corrected from `PROGRAM_SCHEDULED_MANUAL_MODE_` to `PROGRAM_SCHEDULED_MANUAL_MODE`

- Fix: Build Issues (#1041) (@NorthernMan54)
- Fix: Ensure data is only transmitted on open and ready connections. (#1051) (@hjdhjd)
- Fix: Ensure we check names using the full UTF-8 character set. (#1052) (@hjdhjd)
- Fix: ConfiguredName (#1049) (@donavanbecker)
- Fix: Manufacturer looking at checkName but should look at checkValue. (#1053) (@donavanbecker)

- Implement warning messages for invalid characters in names (#1009) (@NorthernMan54)
- Mitigate event emitter "memory leak" warnings when a significant number of camera streaming events occur simultaneously (#1037) (@hjdhjd)
- AdaptiveLightingController fix & improvement (#1038) (@Shaquu)
- Minor fixes to recording logging and one change in logging. (#1040) (@hjdhjd)
- Bridged core and core cleanup (#1048) (@Shaquu)
- Increase snapshot handler warning timeout to 8000ms. (#1055) (@hjdhjd)
- Cleanup and refactor getLocalNetworkInterface and address a potential edge case. (#1056) (@hjdhjd)
- Correct log spacing
- Updated and fixed `typedoc` config file
- Updated dependencies

- `@homebridge/ciao` @ `v1.3.0`
- `bonjour-hap` @ `v3.8.0`
donavanbecker added a commit that referenced this pull request Jul 11, 2024
## v1.0.0 (2024-07-10)

### Breaking Changes

- **The minimum Node.js version required is now `v18`.**
- **Important notice:** Because of the cleanup of the Deprecated code,
you will need to migrate you code base.
    - Remove the long-deprecated init().
- Deprecate Core, BridgedCore, legacy Camera characteristics. (#1058)
(@hjdhjd)
- For deprecated `Core` and `BridgedCore` see:
https://github.com/homebridge/HAP-NodeJS/wiki/Deprecation-of-Core-and-BridgeCore
    - Legacy code deprecation cleanup. (#1059) (@hjdhjd)
- For deprecated `storagePath` switch to
`HAPStorage.setCustomStoragePath`, `AudioCodec` switch to
`AudioStreamingCodec`, `VideoCodec` switch to
`H264CodecParameters`,`StreamAudioParams` switch to
`AudioStreamingOptions`, `StreamVideoParams` switch to
`VideoStreamingOptions`,`cameraSource` switch to `CameraController`.
- Others deprecated code to highlight removed: `useLegacyAdvertiser`,
`AccessoryLoader`.
- Fix: Naming for Characteristic.ProgramMode has been corrected from
`PROGRAM_SCHEDULED_MANUAL_MODE_` to `PROGRAM_SCHEDULED_MANUAL_MODE`

### Fixed

- Fix: Build Issues (#1041) (@NorthernMan54)
- Fix: Ensure data is only transmitted on open and ready connections.
(#1051) (@hjdhjd)
- Fix: Ensure we check names using the full UTF-8 character set. (#1052)
(@hjdhjd)
- Fix: ConfiguredName (#1049) (@donavanbecker)
- Fix: Manufacturer looking at checkName but should look at checkValue.
(#1053) (@donavanbecker)

### Other Changes

- Implement warning messages for invalid characters in names (#1009)
(@NorthernMan54)
- Mitigate event emitter "memory leak" warnings when a significant
number of camera streaming events occur simultaneously (#1037) (@hjdhjd)
- AdaptiveLightingController fix & improvement (#1038) (@Shaquu)
- Minor fixes to recording logging and one change in logging. (#1040)
(@hjdhjd)
- Bridged core and core cleanup (#1048) (@Shaquu)
- Increase snapshot handler warning timeout to 8000ms. (#1055) (@hjdhjd)
- Cleanup and refactor getLocalNetworkInterface and address a potential
edge case. (#1056) (@hjdhjd)
- Correct log spacing
- Updated and fixed `typedoc` config file
- Updated dependencies

### Homebridge Dependencies

- `@homebridge/ciao` @ `v1.3.0`
- `bonjour-hap` @ `v3.8.0`
@bwp91 bwp91 mentioned this pull request Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants