more api surface, protect some nils, less disconnect events - #87
Merged
Conversation
davidnewhall
commented
Jul 21, 2026
Collaborator
- Protect some nil pointers.
- Only emit event stream disconnect event if it was connected.
- Add redacted url method.
Contributor
There was a problem hiding this comment.
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.InfoandServer.CamerasinNewMustto reduce nil-pointer hazards prior toRefresh(). - Adjust event-stream scanning so
EventStreamDisconnectis not emitted on failed connection attempts. - Add
Camera.VideoURL()andCamera.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 on lines
10
to
14
| - exhaustive | ||
| - nlreturn | ||
| - gomodguard | ||
| - goconst | ||
| settings: |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.