Skip to content

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

@intendednull

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions