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)
| 311 | // HITL pending/reject events especially, a dropped event means the |
| 312 | // reviewer's webhook never fires. |
| 313 | func (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 | |
| 320 | func (a *API) publishSent(ctx context.Context, e webhookpub.Event, outMsg *identity.Message) { |
| 321 | var outboxWrote bool |