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

Method publishRejected

internal/agent/api.go:402–419  ·  view source on GitHub ↗

publishRejected fires email.review_rejected via the outbox (PublishTx — pre-side-effect: rejection is a row update, no SES involvement) AND the legacy goroutine.

(ctx context.Context, e webhookpub.Event, rejectedMsgID string)

Source from the content-addressed store, hash-verified

400// pre-side-effect: rejection is a row update, no SES involvement) AND
401// the legacy goroutine.
402func (a *API) publishRejected(ctx context.Context, e webhookpub.Event, rejectedMsgID string) {
403 var outboxWrote bool
404 if a.outbox != nil && rejectedMsgID != "" {
405 e.ID = webhookpub.DeterministicEventID(rejectedMsgID, e.Type)
406 err := a.store.WithTx(ctx, func(tx pgx.Tx) error {
407 return a.outbox.PublishTx(ctx, tx, e)
408 })
409 if err != nil {
410 log.Printf("[api] outbox tx for %s err: %v", e.Type, err)
411 } else {
412 outboxWrote = true
413 }
414 }
415 a.emit().OutboxEventsPublished(e.Type)
416 if a.shouldFireLegacy(outboxWrote) {
417 a.publishAsync(e)
418 }
419}
420
421// SetApprovalSigner wires in the magic-link signer after construction so
422// callers (and tests) that don't need HITL magic-link endpoints don't

Callers 2

RejectPendingCoreMethod · 0.95

Calls 7

emitMethod · 0.95
shouldFireLegacyMethod · 0.95
publishAsyncMethod · 0.95
DeterministicEventIDFunction · 0.92
WithTxMethod · 0.80
PublishTxMethod · 0.65
OutboxEventsPublishedMethod · 0.65

Tested by

no test coverage detected