Skip to content

fix(db): check rows.Err after iterating query results - #539

Merged
BaaRai merged 2 commits into
BaaRai:mainfrom
zombrax1:claude/rows-err-check
Nov 26, 2026
Merged

BaaRai merged 2 commits into
BaaRai:mainfrom
zombrax1:claude/rows-err-check

Conversation

@zombrax1

Copy link
Copy Markdown
Contributor

ListLogs, ListLogsBefore and the two task_relations reads in the task archive code never checked rows.Err(). When a result set fails partway (connection drop, statement timeout), Next returns false and closes the rows, so the later Close returns nil and the caller got a silently truncated list: missing log lines, or an archive whose source tasks are incomplete.

ListLogs, ListLogsBefore and the two task_relations reads in the task
archive code never checked rows.Err(). When a result set fails partway
(connection drop, statement timeout), Next returns false and closes the
rows, so the later Close returns nil and the caller got a silently
truncated list: missing log lines, or an archive whose source tasks
are incomplete.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JNRiKGwr3P1LP1njD8FbR4
@5P34R

5P34R commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Review notes

Looks good to merge. The checks are correct in db/logs.go and at both db/task_archives.go sites.

One small behaviour change: an error partway through RecentLogs now skips the log-history restore instead of restoring partial history. That seems fine.

@BaaRai
BaaRai force-pushed the claude/rows-err-check branch 4 times, most recently from 81d1b7f to 0f52d3e Compare November 26, 2026 22:56
@BaaRai
BaaRai force-pushed the claude/rows-err-check branch from 0f52d3e to 6d7b83a Compare November 26, 2026 23:15
@BaaRai
BaaRai merged commit 4851aee into BaaRai:main Nov 26, 2026
6 checks passed
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.

4 participants