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
- Enable the iMessage plugin, confirm it's running
- Confirm Full Disk Access is granted and
access.jsonis configured - Send a text to yourself (self-chat)
- Message lands in
chat.db(confirmed viasqlite3CLI) but the plugin never delivers anotifications/claude/channelnotification
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
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗