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)
| 400 | // pre-side-effect: rejection is a row update, no SES involvement) AND |
| 401 | // the legacy goroutine. |
| 402 | func (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 |
no test coverage detected