Skip to content

PersistEvent handler never writes events to disk #44

@intendednull

Description

@intendednull

Problem

The PersistEvent handler in crates/client/src/persistence_actor.rs only appends events to an in-memory Vec<Event> but never calls any storage function to persist them to disk or SQLite. Other persist handlers (PersistServerState, PersistServerConfig, etc.) all call storage::save_* when persistence_enabled is true.

This means events accumulated via PersistEvent are silently lost on restart. The LoadAllEvents handler returns this in-memory list, confirming it's intended as a buffer, but the name "PersistEvent" is misleading.

Suggested fix

Either:

  • Actually persist events to storage (e.g., call storage::save_events() or write to a SQLite event store)
  • Rename to BufferEvent to clarify it's in-memory only
  • Remove the handler if events are persisted through another mechanism (e.g., the DAG is persisted separately)

Location

crates/client/src/persistence_actor.rs:77-85

Found during audit of #26.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions