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

Method CreateInboundMessageInTx

internal/identity/store.go:1190–1192  ·  view source on GitHub ↗

CreateInboundMessageInTx writes the messages row inside the caller's transaction. Used by the slice-3 relay refactor (per design §4.2) so the messages INSERT and the webhook_events outbox INSERT commit together, closing the at-least-once publish-loss window. Mirrors the CreateAgentTx pattern at sto

(ctx context.Context, tx pgx.Tx, id, agentID, senderEmail, recipient, emailMessageID, subject, conversationID, deliveryStatus string, rawMessage []byte, authHeaders map[string]string, authVerdict []byte, flagged bool, flagReason string, toRecipients, cc, replyTo []string, screening InboundScreening)

Source from the content-addressed store, hash-verified

1188// body, executed against either *pgxpool.Pool or pgx.Tx via the
1189// messageExecutor interface below.
1190func (s *Store) CreateInboundMessageInTx(ctx context.Context, tx pgx.Tx, id, agentID, senderEmail, recipient, emailMessageID, subject, conversationID, deliveryStatus string, rawMessage []byte, authHeaders map[string]string, authVerdict []byte, flagged bool, flagReason string, toRecipients, cc, replyTo []string, screening InboundScreening) (*Message, error) {
1191 return createInboundMessage(ctx, tx, id, agentID, senderEmail, recipient, emailMessageID, subject, conversationID, deliveryStatus, rawMessage, authHeaders, authVerdict, flagged, flagReason, toRecipients, cc, replyTo, screening)
1192}
1193
1194// messageExecutor is the subset of *pgxpool.Pool and pgx.Tx that
1195// createInboundMessage needs. Parallel to agentExecutor (which already

Callers 2

deliverToAgentMethod · 0.80

Implementers 1

Storeinternal/identity/store.go

Calls 1

createInboundMessageFunction · 0.85

Tested by 1