Skip to content

fix(dashboard): address Go backend CodeRabbit review comments#85

Merged
justinjdev merged 2 commits intofeat/command-dashboardfrom
worktree-fix-go-backend-coderabbit-pr76
Mar 21, 2026
Merged

fix(dashboard): address Go backend CodeRabbit review comments#85
justinjdev merged 2 commits intofeat/command-dashboardfrom
worktree-fix-go-backend-coderabbit-pr76

Conversation

@justinjdev
Copy link
Copy Markdown
Owner

Summary

  • Add file locking (flock) and PID-unique tmp paths to command queue for cross-process safety
  • Handle rand.Read error in generateID()
  • Handle UserHomeDir error on config write path
  • Change NewServer to return (*Server, error) instead of calling log.Fatalf
  • Fix WebSocket Broadcast to not hold mutex during network I/O (snapshot-then-write)
  • Fix misleading CheckOrigin comment in WebSocket upgrader
  • Run go mod tidy

Context

Addresses Go backend review comments from PR #76. Six of the original 12 items were already fixed in prior commits; this PR covers the remaining 7.

Test plan

  • All existing tests pass (go test ./...)
  • Build compiles cleanly (go build ./...)
  • go vet ./... clean
  • Adversarial review (balrog) — no critical findings

🤖 Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 21, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 95dc6c1a-53db-4cee-a001-b92fc7524101

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-fix-go-backend-coderabbit-pr76

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@justinjdev justinjdev marked this pull request as ready for review March 21, 2026 22:47
justinjdev and others added 2 commits March 21, 2026 17:49
- queue.go: handle rand.Read error, use unique tmp path per PID,
  add file locking (flock) for cross-process safety
- data.go: handle UserHomeDir error on config write path
- server.go: NewServer returns error instead of log.Fatalf
- ws.go: snapshot conns under RLock before writing to avoid holding
  mutex during network I/O; fix misleading CheckOrigin comment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…otent close

- ws.go: introduce wsConn wrapper with per-connection write mutex
  (gorilla/websocket requires serialized writes) and sync.Once Close
  to prevent double-close on concurrent Remove + Broadcast failure
- data.go: move error check before suffix filter in handleAutopsies
  to avoid masking DB errors as 404
- data.go: use PID-unique tmp path in handleConfigWrite, consistent
  with queue.go SaveCommandQueue

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@justinjdev justinjdev force-pushed the worktree-fix-go-backend-coderabbit-pr76 branch from aabb8f1 to 92f291b Compare March 21, 2026 22:49
@justinjdev justinjdev merged commit 9fd0a73 into feat/command-dashboard Mar 21, 2026
1 check was pending
@justinjdev justinjdev deleted the worktree-fix-go-backend-coderabbit-pr76 branch March 21, 2026 22:49
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