Skip to content

fix: tolerate null source import checksums#381

Merged
mariusvniekerk merged 2 commits into
kenn-io:mainfrom
danshapiro:codex/null-source-import-checksum
Jun 15, 2026
Merged

fix: tolerate null source import checksums#381
mariusvniekerk merged 2 commits into
kenn-io:mainfrom
danshapiro:codex/null-source-import-checksum

Conversation

@danshapiro

Copy link
Copy Markdown
Contributor

What changed

  • Scan source import item checksums through sql.NullString in GetSourceImportItem and ListImportedSourceItemChecksums.
  • Surface an empty checksum string when legacy/imported rows contain NULL.
  • Add focused store coverage for NULL checksum rows.

Why

Some source_import_items rows can have NULL checksum values, which previously caused scan errors when imported source items were read back.

Impact

Nullable checksums no longer break source import lookup or imported checksum listing; non-NULL checksum behavior is unchanged.

Validation

  • gofmt on touched Go files
  • go test -tags "fts5 sqlite_vec" ./internal/store
  • make testify-helper-check
  • go vet -tags "fts5 sqlite_vec" ./...

@roborev-ci

roborev-ci Bot commented Jun 13, 2026

Copy link
Copy Markdown

roborev: Combined Review (a9c82e7)

Verdict: No Medium, High, or Critical issues found.

The only reported finding was Low severity, so it is omitted per the review-combination rules.


Panel: ci_default_security | Synthesis: codex, 5s | Members: codex_default (codex/default, done, 1m51s), codex_security (codex/security, done, 12s) | Total: 2m8s

@wesm wesm marked this pull request as ready for review June 15, 2026 13:58
The NULL checksum regression coverage needs to run against both SQLite and PostgreSQL. The test forced a legacy NULL row through the raw DB handle, which bypasses the store logger's automatic placeholder rebinding and left PostgreSQL with SQLite-style question-mark placeholders.

Use the store dialect rebind helper for that direct SQL so the coverage exercises the intended nullable checksum behavior on both backends instead of failing before it reaches the scan path.

Validation: go test -tags "fts5 sqlite_vec" ./internal/store -run TestStore_SourceImportItems -count=1; MSGVAULT_TEST_DB=postgres://msgvault_test:msgvault_test@localhost:55432/msgvault_test?sslmode=disable go test -tags "fts5 sqlite_vec" ./internal/store -run TestStore_SourceImportItems -count=1; make test; make testify-helper-check

Generated with Codex
Co-authored-by: Codex <noreply@openai.com>
@roborev-ci

roborev-ci Bot commented Jun 15, 2026

Copy link
Copy Markdown

roborev: Combined Review (df9a912)

No issues found.


Panel: ci_default_security | Synthesis: codex | Members: codex_default (codex/default, done, 47s), codex_security (codex/security, done, 9s) | Total: 56s

@mariusvniekerk mariusvniekerk merged commit 9f1f8e0 into kenn-io:main Jun 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants