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

Method shouldFireLegacy

internal/agent/api.go:313–318  ·  view source on GitHub ↗

publishSent fires email.sent via BOTH the legacy publisher (in a goroutine) AND the slice-4 transactional outbox path. The outbox uses PublishBestEffortTx because SES has already accepted the send — the messages row write + outbox write happen in one tx so the outbox commit is durable, but failure t

(outboxWrote bool)

Source from the content-addressed store, hash-verified

311// HITL pending/reject events especially, a dropped event means the
312// reviewer's webhook never fires.
313func (a *API) shouldFireLegacy(outboxWrote bool) bool {
314 if a.outbox == nil || !a.outbox.Enabled() {
315 return true // legacy is the sole delivery path
316 }
317 return !outboxWrote // legacy is the fallback when outbox didn't write
318}
319
320func (a *API) publishSent(ctx context.Context, e webhookpub.Event, outMsg *identity.Message) {
321 var outboxWrote bool

Calls 1

EnabledMethod · 0.65