iMessage plugin: readonly SQLite connection misses new WAL writes from Messages.app

Resolved 💬 3 comments Opened Mar 26, 2026 by fmonugian43-design Closed Mar 30, 2026

Bug

The iMessage channel plugin opens chat.db with { readonly: true } (server.ts line 59). On macOS, Messages.app uses WAL (Write-Ahead Logging) journal mode. A readonly SQLite connection cannot see new writes that land in the WAL file from another process, so the plugin's poll loop never picks up new inbound messages.

Steps to reproduce

  1. Enable the iMessage plugin, confirm it's running
  2. Confirm Full Disk Access is granted and access.json is configured
  3. Send a text to yourself (self-chat)
  4. Message lands in chat.db (confirmed via sqlite3 CLI) but the plugin never delivers a notifications/claude/channel notification

Root cause

server.ts line 59:

db = new Database(CHAT_DB, { readonly: true })

The qPoll query (line 114) runs every 1s via setInterval but operates on a stale snapshot because bun:sqlite's readonly mode doesn't re-read WAL pages written by Messages.app.

Environment

  • macOS 15 (Darwin 25.3.0)
  • Claude Code 2.1.78
  • iMessage plugin 0.0.1
  • chat.db journal_mode: WAL

Suggested fix

Either:

  • Re-open the database connection periodically
  • Open without readonly: true (plugin only reads, so this should be safe)
  • Execute a WAL checkpoint before each poll query

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗