Skip to content

1d: Handle transactions in trapfalld digest + WebSocket broadcast #238

Description

@ajianaz

Parent: #231 · Blocked by: #236, #237

Scope

Wire transaction handling into the existing digest loop and WebSocket broadcast pipeline.

Changes

ServerMessage enum — add variant

pub enum ServerMessage {
    IssueCreated { issue: Issue },
    IssueUpdated { issue: Issue },
    EventReceived { issue_id: String, event_id: String },
    TransactionReceived { transaction_id: String, name: String, duration_ms: f64 }, // NEW
}

Digest loop — handle ParsedEnvelope.transactions

  • After processing events, check if envelope has transactions
  • Insert each transaction into DB via insert_transaction()
  • Broadcast TransactionReceived to subscribed WebSocket clients for that project

Tasks

  • Add TransactionReceived variant to ServerMessage
  • In digest loop: iterate envelope.transactions after envelope.events
  • Insert transaction to DB
  • Broadcast WebSocket message
  • Add error handling: log + skip on DB insert failure (don't drop events)
  • Add test: mock envelope with transaction → verify DB insert + broadcast

Effort: ~2 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestscope:ingestEnvelope ingest / parser changestype:envelopeSentry envelope item type expansion

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions