MemberJunction / MemberJunction/MJ

Communication: MessageResult has no result-code field — per-row statuses like Skipped/Suppressed cannot be expressed

Open
#2,818 0 comments 0 reactions 1 assignee Claimed by @SDesai-BC View on GitHub
enhancement
Dominant language
TSQL
Stars
29
Forks
6
Avg merge
1d 8h
Merged PRs (30d)
308

Description

## What to build

Extend `MessageResult` (in `packages/Communication/base-types/src/BaseProvider.ts`, currently `{ Run?, Message, Success, Error }`) with a result-code field so batch sends can report per-row outcomes beyond a boolean.

Concrete needs that cannot be expressed today:

- **Skipped** — idempotent batch sends (retry of a half-failed batch) need to report "already sent, not re-sent" per row without it reading as either success-sent or failure
- **Suppressed** — a future engine-level suppression/unsubscribe check (see the suppression issue) needs to report "intentionally not sent" per row
- Provider-specific soft-fails (rate-limited, deferred) vs hard fails

## Proposed shape

Additive: `ResultCode?: string` (or a small union: `'Sent' | 'Skipped' | 'Suppressed' | 'Failed'` with room for provider codes), defaulting to the current boolean semantics when absent. Engine populates it where it already knows the outcome; providers may set provider-specific codes.

## Acceptance criteria

- [ ] `MessageResult` carries an optional result code; absent = existing semantics, no breaking change
- [ ] `Engine.SendMessages` returns per-message results whose codes distinguish sent / failed at minimum
- [ ] Communication Log rows record the result code

## Blocked by

None - can start immediately (pairs naturally with the batch-send error-semantics issue)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.