Skip to content

hotfix/agent v3.3.19 - downgrade to v0.0.14 #188

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cedricve
Copy link
Member

@cedricve cedricve commented May 20, 2025

Description

Pull Request: hotfix/agent v3.3.19 - downgrade to v0.0.14

Motivation and Improvement

The primary motivation behind this hotfix is to address compatibility issues and stability concerns that have arisen with the latest version (v1.0.0) of the github.com/kerberos-io/onvif library. By downgrading to an earlier, more stable version (v0.0.14), we aim to mitigate these issues and ensure the smooth functioning of our system.

Changes Introduced

  1. Dependency Downgrade:

    • Downgraded github.com/kerberos-io/onvif from v1.0.0 to v0.0.14 in machinery/go.mod and machinery/go.sum.
  2. Code Adjustments:

    • Commented out or adjusted code sections that relied on features or functions introduced in the newer version of the onvif library which are not present or stable in v0.0.14.
    • Specifically, parts of the code dealing with relay outputs and digital inputs have been commented out to prevent runtime errors and maintain functionality.

Benefits

  • Stability: By reverting to a more stable version of the onvif library, we reduce the risk of crashes and bugs related to the newer, less stable version.
  • Compatibility: Ensures that our codebase remains compatible with the onvif library, preventing unexpected behavior and errors.
  • Maintainability: Simplifies maintenance by relying on a well-tested and stable library version, reducing the need for frequent hotfixes and patches.

This hotfix is a crucial step in maintaining the reliability and performance of our system. It addresses immediate concerns while we work on a more permanent solution for integrating the latest features of the onvif library.

@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 12:38
Copy link
Contributor

@Copilot Copilot AI left a comment

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 downgrades the github.com/kerberos-io/onvif dependency to v0.0.14 and temporarily disables ONVIF-based handlers by commenting out their implementations to maintain compatibility with the older API.

  • Comment out ONVIF credential binding and response in DoGetDigitalInputs
  • Disable relay output logic in TriggerRelayOutput and heartbeat handler
  • Update go.mod to pin onvif at v0.0.14 and remove unused indirect deps

Reviewed Changes

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

File Description
machinery/src/routers/http/methods.go Disabled JSON binding and logic in DoGetDigitalInputs
machinery/src/onvif/main.go Commented out GetRelayOutputs call and relay-trigger logic
machinery/src/cloud/Cloud.go Commented out relay output retrieval in heartbeat loop
machinery/go.mod Downgraded github.com/kerberos-io/onvif and pruned indirect deps
Comments suppressed due to low confidence (4)

machinery/src/onvif/main.go:1271

  • [nitpick] The variable name relayoutputs looks like a typo and can be confusing. Consider renaming it to relayOutputs for clarity.
relayoutputs, err := GetRelayOutputs(dev)

machinery/src/routers/http/methods.go:380

  • The entire body of DoGetDigitalInputs is commented out, turning this handler into a no-op. Either remove the unused endpoint or restore the JSON binding and error handling to keep its functionality.
/*var onvifCredentials models.OnvifCredentials

machinery/src/onvif/main.go:1271

  • Key logic in TriggerRelayOutput is commented out, so no relay outputs are fetched or triggered. Re-enable or adapt this block to match the downgraded onvif API and preserve the intent.
//relayoutputs, err := GetRelayOutputs(dev)

machinery/src/cloud/Cloud.go:369

  • Disabling this relay output retrieval leaves events empty and alters the heartbeat behavior. Restore or update this block to ensure the correct events are collected.
/*outputs, err := onvif.GetRelayOutputs(device)

@@ -21,7 +21,7 @@ require (
github.com/gorilla/websocket v1.5.3
github.com/kellydunn/golang-geo v0.7.0
github.com/kerberos-io/joy4 v1.0.64
Copy link
Preview

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

[nitpick] Since the onvif module is being downgraded, please add a comment explaining the rollback reason and any compatibility notes for future maintainers.

Suggested change
github.com/kerberos-io/joy4 v1.0.64
github.com/kerberos-io/joy4 v1.0.64
// Downgraded to v0.0.14 due to compatibility issues with newer versions causing runtime errors in ONVIF device discovery.
// Future maintainers: Test thoroughly before upgrading this module to ensure compatibility with the current codebase.

Copilot uses AI. Check for mistakes.

@cedricve
Copy link
Member Author

Some users complain PTZ is not working with latest version of ONVIF.https://github.com/kerberos-io/onvif/releases/tag/v1.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant