Skip to content

fix: 10 verified bug fixes across 7 files#76

Open
marcus wants to merge 1 commit intomainfrom
bug-finder/verified-fixes
Open

fix: 10 verified bug fixes across 7 files#76
marcus wants to merge 1 commit intomainfrom
bug-finder/verified-fixes

Conversation

@marcus
Copy link
Copy Markdown
Owner

@marcus marcus commented Mar 24, 2026

Summary

  • Transaction resource leak in internal/serve/sse.go: serveAutoSyncPull was missing defer tx.Rollback() after Begin(), so a failed Commit() would leak the transaction
  • 2 unchecked critical errors in cmd/ws.go: UpdateIssueLogged and RecordSessionAction return values silently discarded (unlike identical pattern in cmd/start.go which checks errors)
  • 5 unchecked RowsAffected() errors in internal/serverdb/ (users.go, projects.go, memberships.go): n, _ := res.RowsAffected() masks database errors as misleading "not found"
  • 4 unchecked RowsAffected() errors in internal/db/notes.go: PinNote, UnpinNote, ArchiveNote, UnarchiveNote same pattern
  • Silent scan error swallowing in internal/db/activity.go GetActiveSessions: scan errors silently continued past, hiding data corruption

Test plan

  • go build compiles cleanly
  • go test ./internal/serve/ ./cmd/ ./internal/serverdb/ ./internal/db/ all pass

🤖 Generated with Claude Code


Automated by nightshift

@marcus marcus force-pushed the bug-finder/verified-fixes branch from 797b611 to a3135df Compare March 24, 2026 10:50
@marcus marcus changed the title fix: 10 verified bugs — resource leaks, unchecked errors, silent failures fix: 10 verified bugs across 7 files Mar 24, 2026
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>
@marcus marcus force-pushed the bug-finder/verified-fixes branch from a3135df to 592dae9 Compare March 24, 2026 10:54
@marcus marcus changed the title fix: 10 verified bugs across 7 files fix: 10 verified bug fixes across 7 files Mar 24, 2026
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