Skip to content

[audit] Add SQLite characterization tests for mutable repositories #290

Description

@bnema

Summary

Several mutable SQLite repositories have no direct repository-level characterization tests.

Why this matters

Usecase-heavy tests mock these repos, so SQLC mapping bugs, null handling issues, transaction mistakes, or persistence regressions can slip through.

Evidence

  • internal/infrastructure/persistence/sqlite/favorite_repo.go
  • internal/infrastructure/persistence/sqlite/permission_repo.go
  • internal/infrastructure/persistence/sqlite/session_state_repo.go
  • internal/infrastructure/persistence/sqlite/zoom_repo.go
  • Nearby direct tests exist for history, favicon, and session repos, but not for these mutable repos.

Suggested scope

  • Add direct repository tests for favorites/folders/tags, permissions, session state, and zoom levels.
  • Cover create/update/delete/list flows, null fields, duplicate/constraint behavior, and transaction boundaries.
  • Reuse existing temp-DB migration helpers where possible.

Acceptance criteria

  • Each mutable repo has at least one direct round-trip test suite.
  • Transactional and null-handling behavior is covered where relevant.
  • The new tests run in the normal repository test command.

Audit context

  • Audit date: 2026-06-10
  • Audited at commit: 5eba8fd5

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditRaised from a structured codebase auditgoPull requests that update go codehelp wantedExtra attention is neededpriority: mediumMedium prioritytestsTest coverage or verification work

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions