getPool/getStats memoized on total_changes(), which counts only the
rows this connection changed. Every operator recipe in the README's
"Operational notes" opens a second connection, so none of them moved it:
an admin opt_outs row placed over railway ssh made /profile/[did]
report optedOut: true while the leaderboard still listed them, until the
app happened to write something of its own. The firehose is filtered to two
collections, so that can be hours — and after VOTING_CLOSES_AT the indexer
stops writing altogether.
PRAGMA data_version is the exact complement: SQLite bumps it when another
connection commits and leaves it alone for this one's own writes. Key the
memo on both.
The new test uses a temp file rather than :memory:: an in-memory database
belongs to the connection that opened it, and better-sqlite3 does not enable
SQLite's URI filenames, so file:…?cache=shared would just create a file
with a very silly name.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com Claude-Session: https://claude.ai/code/session_014b7ro8Qu3VrovKm6uv2aJR