Efficient monitor that detects and preserves deleted iMessages using WAL file monitoring.
This project is an enhanced fork of this repo, which itself builds on ReagentX/imessage-exporter's
imessage-databaselibrary
Detects deleted/edited messages:
- 📱 Message content - Full text with formatting
- 🖼️ Attachments - Images, videos, files
- 👤 Contact info - Sender/receiver details
- ⏰ Timestamps - Send and deletion times
The system uses WAL monitoring with an event-style processing pipeline:
- WAL Size Polling (every 1000ms): Checks
chat.db-walfile size - Change Detection: If WAL size changed → queries database for modified messages
- Fingerprint Comparison: Compares previous state (from state DB) vs current state (from iMessage DB)
- Deletion Detection: Detects when message content transitions from non-empty → empty
- State Persistence: Stores fingerprints in SQLite for restart resilience
- Output: Writes to JSON, SQLite, terminal, or webhooks via async streams
- WAL file monitoring: Checks file metadata (~0.1ms) instead of querying database every 500ms
- Conditional queries: Only queries database when WAL size changes (not continuously)
- ~Way less CPU when idle: a db query is roughly 10–100× more expensive than checking the WAL file
- Async streams: Better concurrency
- Persistent state: Saves message fingerprints to SQLite (
tracker_state.db), survives restarts - Detects deletions that happened while app was offline: Compares stored fingerprints on startup
- State management: Tracks message history even after crashes
- Open System Settings → Privacy & Security → Full Disk Access
- Add your terminal application
- Restart terminal
Test that permissions work:
ls -la /Users/$USER/Library/Messages/Failure: "Operation not permitted" - repeat step 1
Navigate to the tracker directory first:
cd imessage-eda-tracker/imessage-undeleterBasic usage:
# Start monitoring all conversations
cargo run