You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three issues from Cursor Bugbot's review on commit 1d41410, plus the
golangci-lint failures from the same CI run.
1. Deadlock in writeUpdate (HIGH severity).
Conn.LockWrite acquired writeMu, then Conn.Flush at the end
re-acquired the same non-reentrant mutex. Every VNC client hung on
its first FramebufferUpdate; this is most likely the actual cause
of the placeholder-forever symptom seen on-device.
The intended pattern was a multi-call composite write with a
private flushLocked variant — but in practice we have a strict
single-writer model: serveClient drives the handshake on its own
goroutine, then the dispatcher goroutine is the only writer
afterward. The reader goroutine never writes. So the mutex adds
no safety, only a deadlock. Strip writeMu, LockWrite, UnlockWrite,
and flushLocked. Document the single-writer requirement on Conn.
2. SetEncodings allocated on the wire-supplied count (LOW severity).
make([]EncodingType, count) was allocating up to 65 535 * 4 bytes
regardless of the maxEncodings cap (256). Allocate based on the
capped n; the loop still drains the full count from the wire so
framing for the next message stays aligned.
3. Save button hidden when VNC was disabled in the UI (MEDIUM
severity).
The button lived inside the {settings.enabled && (...)} block, so
unchecking the toggle hid the button — the disabled state could
not be persisted. Move the button outside the conditional.
Linter follow-ups (golangci-lint v2.4 in CI):
- goimports re-aligned const blocks in keysym.go and placeholder.go.
- Removed the unused acquireVideoStream wrapper now that all callers
pass an explicit codec.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments