Skip to content

fix: CLI capabilities parsing and Go relay SQLite read/write race#44

Merged
bvalosek merged 1 commit intomainfrom
fix/sqlite-read-store-race
Apr 15, 2026
Merged

fix: CLI capabilities parsing and Go relay SQLite read/write race#44
bvalosek merged 1 commit intomainfrom
fix/sqlite-read-store-race

Conversation

@bvalosek
Copy link
Copy Markdown
Member

Summary

  • CLI capabilities fix: RelayInfo struct now correctly parses the nested capabilities object from the relay well-known response. Previously proof and content fields deserialized as false because the struct expected them at the top level, not under capabilities.
  • Go relay SQLite race fix: HTTP read handlers (routes, auth) now use a read-only SQLiteStore view that always reads from the WAL read connection pool. Previously, readerDB() could return an active write transaction to concurrent HTTP handlers, which would fail with "transaction has already been committed" when ingestion committed the batch mid-query. The ingestion path still sees the write transaction for within-batch read consistency.

Test plan

  • Go relay builds and unit tests pass
  • CLI builds, relay info and relay list show correct content: yes / proof: yes
  • Conformance tests against peered relays (the scenario that surfaces the race)
  • CI

Generated with Claude Code

Two fixes:

1. CLI: RelayInfo struct now correctly reads capabilities from the
   nested `capabilities` object in the well-known response instead of
   expecting top-level `proof`/`content` fields (which always
   deserialized as false).

2. Go relay: HTTP read handlers (routes, auth) now use a read-only
   SQLiteStore view that always reads from the WAL read connection pool,
   never from an active write transaction. Previously, concurrent HTTP
   reads could grab the ingestion transaction via readerDB(), then fail
   with "transaction has already been committed" when ingestion committed
   the batch mid-query.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bvalosek bvalosek merged commit f0d05ca into main Apr 15, 2026
9 checks passed
@bvalosek bvalosek deleted the fix/sqlite-read-store-race branch April 15, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant