Skip to content

more api surface, protect some nils, less disconnect events - #87

Merged
davidnewhall merged 3 commits into
mainfrom
dn2_jpeg_fixes
Jul 21, 2026
Merged

more api surface, protect some nils, less disconnect events#87
davidnewhall merged 3 commits into
mainfrom
dn2_jpeg_fixes

Conversation

@davidnewhall

Copy link
Copy Markdown
Collaborator
  • Protect some nil pointers.
  • Only emit event stream disconnect event if it was connected.
  • Add redacted url method.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 expands the SDK API surface and improves robustness by initializing additional sub-interfaces, adding nil-safety guards on camera accessors, refining when event-stream disconnect events are emitted, and introducing helpers to obtain/redact RTSP(S) stream URLs for logging.

Changes:

  • Initialize Server.Info and Server.Cameras in NewMust to reduce nil-pointer hazards prior to Refresh().
  • Adjust event-stream scanning so EventStreamDisconnect is not emitted on failed connection attempts.
  • Add Camera.VideoURL() and Camera.RedactedVideoURL() helpers and extend tests to validate redaction.

Reviewed changes

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

Show a summary per file
File Description
securityspy.go Initialize Info and Cameras in NewMust to prevent nil access before refresh.
events.go Stop emitting disconnect events when the dial/connect attempt fails.
cameras.go Add nil guards on Cameras accessors; add VideoURL/RedactedVideoURL helpers used by video capture paths.
cameras_internal_test.go Add coverage verifying password redaction in RedactedVideoURL.
.golangci.yml Disable the goconst linter (CI/static-analysis behavior change).

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

Comment thread cameras.go
Comment thread .golangci.yml
Comment on lines 10 to 14
- exhaustive
- nlreturn
- gomodguard
- goconst
settings:
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@davidnewhall
davidnewhall enabled auto-merge July 21, 2026 01:39
@davidnewhall
davidnewhall merged commit 40d9d80 into main Jul 21, 2026
8 checks passed
@davidnewhall
davidnewhall deleted the dn2_jpeg_fixes branch July 21, 2026 01:40
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.

2 participants