MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / fakeAgentOutbox

Struct fakeAgentOutbox

internal/agent/webhooks_events_test.go:222–229  ·  view source on GitHub ↗

─── C3 fix: dual-path dedup ────────────────────────────────────── When the outbox flag is on, the API's publish helpers must NOT also fire the legacy publisher.Publish goroutine. Two writes to webhook_subscriber_deliveries — one from the outbox worker (with event_id set) and one from publisher.Pub

Source from the content-addressed store, hash-verified

220// level tests. Records best-effort + PublishTx calls and lets the
221// test toggle Enabled() to exercise the dedup branch.
222type fakeAgentOutbox struct {
223 enabled bool
224 publishTxN int
225 publishTxErr error // simulate PublishTx failure for fallback tests
226 bestEffortN int
227 bestEffortWrote bool // simulate PublishBestEffortTx wrote=true
228 lastPublishTx webhookpub.Event
229}
230
231func (f *fakeAgentOutbox) PublishTx(_ context.Context, _ pgx.Tx, e webhookpub.Event) error {
232 f.publishTxN++

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected