Skip to content

[BUG] NIP-56 report ingestion: dead rows, WoT-rebuild blocking, target truncation, no transaction #785

Closed

Description

@Priyanshubhartistm

Describe the bug

  1. A kind-1984 event with no valid p/e target still inserts a reports row with nothing to act on (src/utils/nip56.ts, src/handlers/event-strategies/report-event-strategy.ts).
  2. The first report accepted after a worker restart blocks on WotGraphService's full graph rebuild via getDistance() -> ensureBuilt(), a one-time latency spike on the event-accept path.
  3. extractReportTargets only reads the first p and first e tag -- a report naming many pubkeys silently records just one, with no cap or log line.
  4. The event insert and target-row insert(s) in ReportEventStrategy aren't wrapped in a transaction -- a partial failure leaves some rows missing, and the existing per-event duplicate guard means a re-sent report never retries, so the loss is silent beyond a log line.

Expected behavior

  • No-target reports are skipped, not stored.
  • Report ingestion doesn't block on a cold-start WoT graph rebuild.
  • All p/e targets on a report event are recorded (or the single-target limit is documented).
  • The event and its report row(s) are inserted atomically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions