publishApproved fires email.review_approved via the outbox (PublishBestEffortTx — POST-side-effect: SES has already accepted the approved send) AND the legacy goroutine.
(ctx context.Context, e webhookpub.Event, sentMsg *identity.Message)
| 378 | // (PublishBestEffortTx — POST-side-effect: SES has already accepted |
| 379 | // the approved send) AND the legacy goroutine. |
| 380 | func (a *API) publishApproved(ctx context.Context, e webhookpub.Event, sentMsg *identity.Message) { |
| 381 | var outboxWrote bool |
| 382 | if a.outbox != nil && sentMsg != nil { |
| 383 | e.ID = webhookpub.DeterministicEventID(sentMsg.ID, e.Type) |
| 384 | err := a.store.WithTx(ctx, func(tx pgx.Tx) error { |
| 385 | outboxWrote = a.outbox.PublishBestEffortTx(ctx, tx, e) |
| 386 | return nil |
| 387 | }) |
| 388 | if err != nil { |
| 389 | log.Printf("[api] outbox tx for %s err: %v", e.Type, err) |
| 390 | outboxWrote = false |
| 391 | } |
| 392 | } |
| 393 | a.emit().OutboxEventsPublished(e.Type) |
| 394 | if a.shouldFireLegacy(outboxWrote) { |
| 395 | a.publishAsync(e) |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | // publishRejected fires email.review_rejected via the outbox (PublishTx — |
| 400 | // pre-side-effect: rejection is a row update, no SES involvement) AND |
no test coverage detected