Skip to content

[GEN-09] MessageDb::insert swallows SQLite errors with .ok(); — silent message loss #269

Closed as not planned

Description

@intendednull

Commit: 2f26d91 · Finding: GEN-09

Problem

Both INSERT branches of MessageDb::insert at crates/client/src/storage.rs:252-261 end with .ok();. The caller has no idea whether a message actually persisted. If the database is locked, disk is full, or a schema migration is pending, the UI still looks like it stored the message and history is silently missing on reload.

Same pattern repeats in storage.rs:413 (save_raw) and in the ALTER TABLE migration at line 244.

Fix

At minimum:

if let Err(e) = self.conn.execute(...) {
    tracing::warn!(%e, "failed to persist message");
}

Better: bubble the error up from insert so callers can surface it.

Obvious fix — will be auto-PR'd.

Activity

  1. intendednull commented on Apr 28, 2026

    @intendednull
    OwnerAuthor

    Closing as moot.

    This issue was filed against commit 2f26d91, but MessageDb, the INSERT branches, the save_raw SQLite path at line 413, and the ALTER TABLE migration at line 244 were all deleted as dead code in 23219af (refactor(client): delete dead message_db field + MessageDb storage, 2026-04-26).

    Verified on master batch branch claude/friendly-maxwell-bVlpW @ 56bd433: crates/client/src/storage.rs is now 350 lines, has no MessageDb, no SQLite INSERT, and no ALTER TABLE. rg 'MessageDb|StoredMessage|open_message_db|ALTER TABLE' crates/client/ returns zero hits.

    Persistence in the client now lives in crates/client/src/persistence_actor.rs, and DAG persistence is handled by SqliteDagStore referenced in storage.rs. If silent-error patterns reappear in those paths, a fresh issue scoped to the new code is the right move.

    Audit-finding GEN-09 no longer applicable on the current tree.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions