-
Notifications
You must be signed in to change notification settings - Fork 105
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 torelayOutputs
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 |
There was a problem hiding this comment.
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.
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.
Some users complain PTZ is not working with latest version of ONVIF.https://github.com/kerberos-io/onvif/releases/tag/v1.0.0 |
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
Dependency Downgrade:
github.com/kerberos-io/onvif
from v1.0.0 to v0.0.14 inmachinery/go.mod
andmachinery/go.sum
.Code Adjustments:
onvif
library which are not present or stable in v0.0.14.Benefits
onvif
library, we reduce the risk of crashes and bugs related to the newer, less stable version.onvif
library, preventing unexpected behavior and errors.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.