Open
Conversation
797b611 to
a3135df
Compare
1. Transaction resource leak in serve/sse.go: serveAutoSyncPull missing defer tx.Rollback() after Begin() - if Commit() fails, the transaction leaks. Added defer and removed redundant manual Rollback() calls. 2. Unchecked errors in cmd/ws.go: UpdateIssueLogged and RecordSessionAction return values were silently discarded, unlike the identical pattern in cmd/start.go which checks errors. Added error checks matching start.go. 3. Five unchecked RowsAffected() errors across serverdb (users.go, projects.go, memberships.go): SetEmailVerified, SetUserAdmin, UpdateProject, SoftDeleteProject, UpdateMemberRole all used `n, _ := res.RowsAffected()` which masks database errors as misleading "not found" messages. Now checks the error return. 4. Four unchecked RowsAffected() errors in db/notes.go: PinNote, UnpinNote, ArchiveNote, UnarchiveNote used `rows, _ := result.RowsAffected()`. Same fix applied. 5. Silent scan error swallowing in db/activity.go GetActiveSessions: scan errors were silently continued past, hiding data corruption or schema issues. Now returns the error. Nightshift-Task: bug-finder Nightshift-Ref: https://github.com/marcus/nightshift Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
a3135df to
592dae9
Compare
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.
Summary
internal/serve/sse.go:serveAutoSyncPullwas missingdefer tx.Rollback()afterBegin(), so a failedCommit()would leak the transactioncmd/ws.go:UpdateIssueLoggedandRecordSessionActionreturn values silently discarded (unlike identical pattern incmd/start.gowhich checks errors)RowsAffected()errors ininternal/serverdb/(users.go, projects.go, memberships.go):n, _ := res.RowsAffected()masks database errors as misleading "not found"RowsAffected()errors ininternal/db/notes.go: PinNote, UnpinNote, ArchiveNote, UnarchiveNote same patterninternal/db/activity.goGetActiveSessions: scan errors silentlycontinued past, hiding data corruptionTest plan
go buildcompiles cleanlygo test ./internal/serve/ ./cmd/ ./internal/serverdb/ ./internal/db/all pass🤖 Generated with Claude Code
Automated by nightshift