Skip to content

Fix incorrect error when log unknown, and add a bunch of tests - #592

Merged
AlCutter merged 1 commit into
transparency-dev:mainfrom
AlCutter:sqlite_no_error
Aug 14, 2026
Merged

Fix incorrect error when log unknown, and add a bunch of tests#592
AlCutter merged 1 commit into
transparency-dev:mainfrom
AlCutter:sqlite_no_error

Conversation

@AlCutter

Copy link
Copy Markdown
Contributor

This PR fixes a couple of bugs in the sqlite storage implementation where:

  • it incorrectly returns an error when config for an unknown log is requested.
  • it failed to check rows.Err after iterating

@AlCutter
AlCutter requested a review from phbnf August 14, 2026 15:34
@AlCutter AlCutter added the bug Something isn't working label Aug 14, 2026
@codecov-commenter

codecov-commenter commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.99%. Comparing base (61e4168) to head (a9fc148).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
persistence/sqlite/sql.go 55.55% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #592      +/-   ##
==========================================
+ Coverage   24.91%   25.99%   +1.08%     
==========================================
  Files          29       29              
  Lines        2408     2454      +46     
==========================================
+ Hits          600      638      +38     
- Misses       1680     1683       +3     
- Partials      128      133       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread persistence/sqlite/sql.go
}
}

func (p *Persistence) Log(ctx context.Context, origin string) (config.Log, bool, error) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: a docstring, or a named variable would help to understand what this bool does.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call - the interface this actually implements is over in omniwitness, which is now a bit disjoint and not so discoverable.

@AlCutter
AlCutter merged commit ed55fd2 into transparency-dev:main Aug 14, 2026
14 checks passed
@AlCutter
AlCutter deleted the sqlite_no_error branch August 14, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants