Skip to content

Conversation

@WyvernIXTL
Copy link
Contributor

@WyvernIXTL WyvernIXTL commented Aug 8, 2025

This PR addresses regressions stemming from the switch to sqlite from sled.

Added:

  • Added specialized initialization errors for sqlite storage backend like in file storage backend prior.

Fixed:

  • Fixed storage tests being abused to test sqlite storage backend.
  • Fixed sqlite provider not creating necessary directories.
  • Changed sqlite storage backend to use a connection pool to reenable multithreaded use of a provider.

Changed:

  • Readded tests from file storage backend to sqlite storage backend.
  • Default filter directive of test logs filters more logs. Dependencies only show error logs now.

Checklist:

  • Do the unit tests in CAL run? Check at least those that you can run: cargo test -F software
  • Are changes in common propagated to all providers that are currently in use?
    • software
    • tpm/android
    • tpm/apple_secure_enclave
  • Did changes in the API occur, such that ./ts-types needs to be updated?
  • Do the dart bindings have to be re-generated?
  • Does the flutter plugin still compile?
  • Do the integration tests in flutter-app still run?
  • There are no build artifacts in the commit. (node_modules, lib, target and everything in .gitignore)

* Fixed SQLite storage backend not creating directories necessary, unlike the filestore did prior.
* Added initialization error to sqlite for better error handling and parsing.
* Readded tests deleted with file store.
The former file store used a pooled connection. The new sqlite storage backend uses one as well now.
This enables multithreaded operations on providers.
@WyvernIXTL WyvernIXTL requested a review from Copilot August 8, 2025 14:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes unit test failures that occurred after migrating from sled to SQLite as the storage backend. The changes address thread safety issues, directory creation problems, and improve error handling for the SQLite storage implementation.

  • Migrated SQLite backend to use connection pooling for thread safety
  • Added specialized initialization errors and directory creation for SQLite
  • Updated test logging configuration to reduce noise from dependencies

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/storage/storage_backend/sqlite_store.rs Major refactor to use connection pooling, add proper error types, and include tests
src/storage/storage_backend/mod.rs Update error type import and remove manual directory creation from tests
src/storage/mod.rs Switch storage tests to use shared test store configuration
src/tests/mod.rs Improve logging configuration with better error handling and default filters
Cargo.toml Add r2d2 connection pooling dependencies and remove direct rusqlite dependency
cSpell.json Add SQLite-related terms to spell checker dictionary

@WyvernIXTL WyvernIXTL merged commit c8098e0 into main Aug 8, 2025
4 checks passed
@WyvernIXTL WyvernIXTL deleted the fix/storage-unit-tests-failing branch August 8, 2025 14:37
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