Skip to content

propagate db errors through vault DbAccess trait#65

Merged
fabracht merged 2 commits into
mainfrom
fix/38-vault-db-helpers-error-propagation
May 21, 2026
Merged

propagate db errors through vault DbAccess trait#65
fabracht merged 2 commits into
mainfrom
fix/38-vault-db-helpers-error-propagation

Conversation

@fabracht
Copy link
Copy Markdown
Contributor

Summary

Closes #38. DbAccess::read_entity now returns Result<Option<Value>, Error> and update_entity returns Result<Value, Error>; the standalone _db and _mqtt helpers + Database/MqttDbAccess/NoopDbAccess impls match. All callers handle the error explicitly:

  • Password change / reset submit: critical updates return Response::error(Internal, ...) on failure instead of silent success; best-effort cleanup updates (marking challenges expired/failed/verified) log warn! and continue.
  • Vault admin ops (enable/unlock/disable/change/status): identity reads and migration state transitions surface failures as VaultError::Internal instead of fire-and-forget.
  • resume_pending_migration and batch encrypt/decrypt log per-record failures with warn!.

Test plan

  • cargo make clippy clean
  • cargo make format-check clean
  • cargo test --workspace --exclude mqdb-wasm — 1013 pass (incl. backend_integration 11/11, constraint_test 34/34, cluster lib 479/479)

@fabracht fabracht merged commit eff9094 into main May 21, 2026
5 checks passed
@fabracht fabracht deleted the fix/38-vault-db-helpers-error-propagation branch May 21, 2026 02:29
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.

propagate errors from vault_ops _db variants instead of collapsing to bool/Option

1 participant