🐛 sec: Fix nil-slice JSON serialization in store layer (12 instances)#13426
Conversation
Replace `var x []T` with `make([]T, 0)` in 4 store files to ensure empty result sets serialize as JSON `[]` instead of `null`. Fixed instances: - sqlite_dashboards.go: GetUserDashboards, GetUserCardHistory, GetRecentEvents - sqlite_features.go: GetUserFeatureRequests, GetAllFeatureRequests, GetPRFeedback, GetUserNotifications - sqlite_gpu.go: ListGPUReservations, ListUserGPUReservations, GetUtilizationSnapshots, ListActiveGPUReservations - sqlite_users.go: GetOnboardingResponses Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ Deploy Preview for kubestellarconsole canceled.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!
This is an automated message. |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
|
Post-merge build verification passed ✅ Both Go and frontend builds compiled successfully against merge commit |
✅ Post-Merge Verification: passedCommit: |
Fixes #13422
Replace
var x []Twithmake([]T, 0)in 4 store files so empty result sets serialize as JSON[]instead ofnull.Fixed instances (12):
Severity: LOW — affects JSON API responses when result set is empty (clients receive
nullinstead of[]).Build verified:
go build ./...passes.