Skip to content

Commit 121640b

Browse files
fix(plugin-email)!: a non-string subject, text or html is the caller's VALIDATION_FAILED, refused before the transport (#32210)
Fixes #32108 Clause-②: no (narrowing) Metadata-protocol: none Skills-docs: none — no published skill or doc page teaches the send body's field types; `SendEmailInput` already declares `subject`, `text` and `html` as strings, and this change only makes the runtime refuse what that type excluded. ## 维护者速读 - 改了什么:`POST /api/v1/email/send`(以及 `IEmailService.send` / `sendInline`)遇到非字符串的 `subject`、`text` 或 `html` 时,在写投递行、调用传输之前直接拒收,返回 400 `VALIDATION_FAILED`,并点名出错字段。 - 为什么改:以前 `html: 123` 返回 200 `status: failed` 加一段 Node 流错误;`subject: {a:1}` 会真的发出主题为 `[object Object]` 的邮件。调用方写错的输入被伪装成投递失败或静默发出。 - 风险与回滚:收紧(BREAKING):以前被强转发出的数字主题现在会被拒收。一方生产者(模板发送、消息中心邮件通道、设置页测试邮件)全部传字符串,实测 0 处受影响。`undefined` / `null` 仍按“未提供”处理,行为不变。回滚即还原 `normalizeMessage` 里三行调用。 - 先看:`packages/plugins/plugin-email/src/email-service.ts` 的 `assertTextField` 与 `normalizeMessage` 开头三行;`packages/rest/src/email-send-display-name.test.ts` 末尾新增的 describe。 - 两分钟验证:`pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/email-send-display-name.test.ts`,预期 24 个用例全绿,其中 3 个新拒收用例断言 400 + `VALIDATION_FAILED` + 点名字段。 - 需要你做的:无,席位落地。 ## What changes `normalizeMessage` (`@objectstack/plugin-email`) now type-checks the message's three text fields before anything else reads them. A `subject`, `text` or `html` that is present but not a string is refused with `VALIDATION_FAILED: FIELD must be a string, not KIND`, naming the field. This is the same throw shape `formatCallerAddress` uses for a malformed recipient, so the REST door's existing catch maps it to `400 {code: VALIDATION_FAILED, error}` with no change to `packages/rest/src/email-routes.ts`. That is the same answer the door already gives for `to: []` and for a display name of 42. The refusal happens before any `sys_email` delivery row or transport call. As with every other pre-delivery refusal, `recordRejectedMessage` still writes one `failed` rejection row with `attempt_count: 0`. `undefined` and `null` are absence, not a wrong type, and keep today's behaviour, now pinned: no subject is still `subject is required`; a `null` or absent `text` beside a string `html` (and the reverse) still sends; `text: ''` with `html: ''` is still `at least one of text or html is required`. Landing point: `normalizeMessage`, as the claim expected. The door's 400 for `to` comes from this same function, so there is no second validator to extend. First-party producers measured, none sending a non-string `subject` / `text` / `html` (count: **0**): - `EmailService.sendTemplate` forwards `RenderedEmailTemplate` fields, which the contract types as strings. - `service-messaging` `email-channel.ts`: the template arm goes through `sendTemplate`; the notification arm forwards `renderNotification` output, built with `String(...)`. - The `mail/test` settings action (`email-plugin.ts`, `sendInline`) passes literals. - Two sites pass caller data through rather than producing it: the REST door (the caller's JSON, which this fixes) and the legacy `email.send.async` queue arm (raw payloads from pre-queue producers outside the workspace). ## Tests - `packages/plugins/plugin-email/src/email-service.test.ts`, a new top-level describe: - Six refusal cases (`html: 123`, `text: {a:1}`, `subject: {a:1}`, `subject: 42`, `html` as an array beside a string `text`, `text: 0` beside a string `html`), each asserting the `VALIDATION_FAILED: ` prefix and that the reason opens with the named field. - `EmailService.send` refuses before the transport is called and records the rejection row without a `body_html`. - Controls: string fields still normalize, and null/absent bodies keep their presence-check answers. - `packages/rest/src/email-send-display-name.test.ts`, a new top-level describe in the existing real-plugin door harness (real `EmailServicePlugin`, real Hono transport): - `html: 123`, `text: {a:1}` and `subject: {a:1}` each answer status 400, `code: VALIDATION_FAILED`, with an `error` that opens with the named field, and leave exactly one `failed` rejection row. - CONTROL: a string subject and body answer 200 `sent`, and so does a `null` `text` beside a string `html`. ## Acceptance notes - The rejection row used to record an object `subject` as `[object Object]`, and a subject whose `toString` is not callable turned the refusal into a 500. Both are fixed in this PR by commit `8eb56764` (contract review F1): `recordRejectedMessage` records `subject` only when it is a string, else `(none)`, as the body columns already did. Pinned at the door and in the service test. - The ablation of the `subject` leg first ran against a version of the fix that had also re-spelled the subject read without `String()`. That mutant answered 500 rather than reproducing the shipped 200, so the spelling was put back (commit `f4f4c918`) and the leg re-run; that re-run's output is below. ## Verification Round-0 readings were taken on head `fa2f882f`; round-1 readings (the F1 fix) are on `8eb56764` (dev report on #32108, comment 6774515672), unless a block says otherwise. <details><summary>Dogfood battery (owed by the narrowing arm), green on the final head</summary> Dependency closure built (`turbo run build --filter='@objectstack/dogfood^...'`, 70/70), then under the shared lock `pnpm --filter @objectstack/dogfood test` (no `OS_TEST_SHARD`, no path): ```text Test Files 446 passed | 3 skipped (449) Tests 3704 passed | 42 skipped (3746) os-verify-lock: VERDICT command-exit 0 · held the lock 2164s (36m04s) ``` </details> <details><summary>Ablation: each field's check deleted alone, both pin files red on exactly that field, restored by blob hash</summary> Run through `node scripts/ablation-replace.mjs --delete` (the anchor must hit exactly once, verified on disk, then restored and checked against the HEAD blob). One leg per field, each running both pin files. Both suites resolve `@objectstack/plugin-email` from `src/` (the plugin's own relative import, and the rest vitest alias), so no `dist/` rebuild is involved. ```text leg html (head 0836ade): anchor x1 -> x0, blob 3924900 -> d28f3b94a2dc plugin-email: Tests 3 failed | 48 passed (51) -- html as a number; html as an array; EmailService.send refuses before transport ("promise resolved instead of rejecting") rest door: Tests 1 failed | 23 passed (24) -- html: 123 -> AssertionError: expected 200 to be 400 restored: blob == HEAD (3924900), git diff HEAD empty leg text (head 0836ade): anchor x1 -> x0, blob 3924900 -> 5b9a6dfab299 plugin-email: Tests 2 failed | 49 passed (51) -- text as an object; text: 0 beside a string html rest door: Tests 1 failed | 23 passed (24) -- text: {a:1} -> AssertionError: expected 200 to be 400 restored: blob == HEAD, git diff HEAD empty leg subject (head f4f4c91, the shipped subject spelling): anchor x1 -> x0, blob 5b68c37 -> 118f8de94e56 plugin-email: Tests 2 failed | 49 passed (51) -- subject as an object; subject as a number rest door: Tests 1 failed | 23 passed (24) -- subject: {a:1} -> AssertionError: expected 200 to be 400 restored: blob == HEAD (5b68c37), git diff HEAD empty ``` The html and text legs ran on `0836ade6`, which differs from `f4f4c918` only in the subject read line, so their readings stand. </details> <details><summary>Local gates: 64 derived, 63 measured green, 1 NOT MEASURED</summary> `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`: 64 families from 4 paths vs merge base `0f7389cca`. Every command was run on `fa2f882f`, with the exit code captured before any pipe, then reconciled: ```text Run reconciliation -- 64 derived, 63 run, 1 NOT-MEASURED, 0 UNRUN. NOT-MEASURED: pnpm check:dual-build-cjs-loads [exit 3 -- PREREQUISITE NOT MET: reads every package's dist/, 51 unbuilt here] ``` - `node scripts/check-plugin-teardown-shape.mjs --self-test` first exited 3: its positive control is pinned to commit `621a4876`, which this shallow clone lacked. After a depth-1 fetch of that commit it passed: `48 cases pass`. - Package suites under the shared lock: - `@objectstack/plugin-email`: `typecheck` (tsc plus `check:test-typecheck`: 0 errors) and `test`: `Test Files 51 passed (51)`, `Tests 843 passed (843)`. - `@objectstack/rest`: `typecheck` (test layer compiles, 0 errors) and `test`: `Test Files 400 passed (400)`, `Tests 7672 passed | 332 skipped (8004)`. - `eslint --no-inline-config` on the three changed `.ts` files: exit 0, no findings. The repo-wide `pnpm lint` is left to CI's lint run. - Control-byte scan over the four changed files: 0 hits. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_012dn2Ae4fomvXPZ2AioCpY4)_ <!-- signed: domain:server#5 · os-bob · session_012dn2Ae4fomvXPZ2AioCpY4 --> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
1 parent 327ef0f commit 121640b

4 files changed

Lines changed: 203 additions & 2 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/plugin-email': patch
3+
---
4+
5+
fix(plugin-email)!: a non-string `subject`, `text` or `html` is the caller's `VALIDATION_FAILED`, refused before the transport (#32108)
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no export or type changes: SendEmailInput already declares subject, text and html as strings, and the send path now refuses at run time the values that type already excluded. The refusal is the existing VALIDATION_FAILED path the send door answers for a malformed recipient, so there is nothing for a migration to rewrite and no tombstone. -->
11+
12+
**BREAKING** accept-set narrowing in `normalizeMessage` (`@objectstack/plugin-email`), served by `IEmailService.send`, `sendInline` and the `POST /api/v1/email/send` door.
13+
14+
After the upgrade, a message whose `subject`, `text` or `html` is present but not a string (a number, an object, an array, a boolean) is refused with `VALIDATION_FAILED` naming the field, before any `sys_email` delivery row is written or the transport is called. Through the REST door that is `400 VALIDATION_FAILED`, the answer it already gives for a malformed recipient. Before, a non-string `text` or `html` answered `200` with `status: "failed"` and a Node stream error, and a non-string `subject` was coerced, so an object sent a mail reading `Subject: [object Object]` and a number sent its digits. The refusal is still recorded as a `failed` rejection row with `attempt_count: 0`, like every other pre-delivery refusal.
15+
16+
`undefined` and `null` are absence, not a wrong type, and behave as before: no subject is still "subject is required", and a `null` or absent `text` beside a string `html` (or the reverse) still sends.
17+
18+
To keep sending, pass these three fields as strings, for example `String(n)` for a numeric subject. First-party producers (`sendTemplate`, the messaging email channel and the settings mail test) already send strings.

‎packages/plugins/plugin-email/src/email-service.test.ts‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,86 @@ describe('normalizeMessage — a malformed CALLER address is the caller\'s VALID
121121
});
122122
});
123123

124+
describe('normalizeMessage — a non-string subject / text / html is the caller\'s VALIDATION_FAILED', () => {
125+
const FROM = 'no-reply@example.test';
126+
const refusal = (input: Record<string, unknown>) => {
127+
try {
128+
normalizeMessage({ to: 'a@b.com', ...input } as any, FROM);
129+
} catch (err) {
130+
return String((err as Error).message);
131+
}
132+
throw new Error('expected normalizeMessage to refuse the input');
133+
};
134+
135+
it.each([
136+
['`html` as a number', { subject: 'x', html: 123 }, 'html'],
137+
['`text` as an object', { subject: 'x', text: { a: 1 } }, 'text'],
138+
['`subject` as an object', { subject: { a: 1 }, html: 'hello' }, 'subject'],
139+
['`subject` as a number', { subject: 42, text: 'hello' }, 'subject'],
140+
['`html` as an array beside a string `text`', { subject: 'x', text: 'ok', html: ['<p>'] }, 'html'],
141+
['`text` as a falsy non-string (0) beside a string `html`', { subject: 'x', html: 'ok', text: 0 }, 'text'],
142+
])('%s is refused VALIDATION_FAILED, naming the field', (_label, input, field) => {
143+
const message = refusal(input);
144+
expect(message.startsWith('VALIDATION_FAILED: ')).toBe(true);
145+
expect(message.slice('VALIDATION_FAILED: '.length).startsWith(`\`${field}\` `)).toBe(true);
146+
});
147+
148+
// An object whose own `toString` is not callable makes `String()` THROW, so
149+
// the rejection row's writer must not coerce it — else a TypeError replaces
150+
// the caller's VALIDATION_FAILED and no row is written.
151+
it.each([
152+
['an object whose toString is not callable', { toString: 1 }],
153+
['an array holding such an object', [{ toString: 1 }]],
154+
])('`subject` as %s: send() rejects VALIDATION_FAILED naming `subject`, and the rejection row is written', async (_label, subject) => {
155+
const rows: Array<Record<string, any>> = [];
156+
const persistence: EmailPersistence = {
157+
async insert(row) { rows.push({ ...row }); return { id: row.id }; },
158+
async update() { /* no-op */ },
159+
};
160+
const transport = { send: vi.fn(async () => ({ messageId: '<m@x>' })) };
161+
const svc = new EmailService({ transport, defaultFrom: FROM, persistence });
162+
163+
await expect(svc.send({ to: 'a@b.com', subject, html: 'hello' } as any)).rejects.toThrow(/^VALIDATION_FAILED: `subject` /);
164+
expect(transport.send).not.toHaveBeenCalled();
165+
expect(rows).toHaveLength(1);
166+
expect(rows[0]).toMatchObject({ status: 'failed', attempt_count: 0, subject: '(none)' });
167+
});
168+
169+
it('EmailService.send refuses before any transport call, and still records the rejection row', async () => {
170+
const rows: Array<Record<string, any>> = [];
171+
const persistence: EmailPersistence = {
172+
async insert(row) { rows.push({ ...row }); return { id: row.id }; },
173+
async update() { /* no-op */ },
174+
};
175+
const transport = { send: vi.fn(async () => ({ messageId: '<m@x>' })) };
176+
const svc = new EmailService({ transport, defaultFrom: FROM, persistence });
177+
178+
await expect(svc.send({ to: 'a@b.com', subject: 'x', html: 123 } as any)).rejects.toThrow(/^VALIDATION_FAILED: `html` /);
179+
expect(transport.send).not.toHaveBeenCalled();
180+
expect(rows).toHaveLength(1);
181+
expect(rows[0]).toMatchObject({ status: 'failed', attempt_count: 0 });
182+
expect(rows[0]).not.toHaveProperty('body_html');
183+
});
184+
185+
// CONTROL — what was legal stays legal: absence (`undefined` / `null`) is
186+
// judged by the presence checks exactly as before, never as a wrong type.
187+
it('string fields still normalize, and a null or absent body beside a string one is still accepted', () => {
188+
expect(normalizeMessage({ to: 'a@b.com', subject: ' Hi ', text: 't', html: '<p>h</p>' }, FROM))
189+
.toMatchObject({ subject: 'Hi', text: 't', html: '<p>h</p>' });
190+
expect(() => normalizeMessage({ to: 'a@b.com', subject: 'Hi', html: '<p>h</p>', text: null } as any, FROM))
191+
.not.toThrow();
192+
expect(() => normalizeMessage({ to: 'a@b.com', subject: 'Hi', text: 't', html: null } as any, FROM))
193+
.not.toThrow();
194+
expect(() => normalizeMessage({ to: 'a@b.com', subject: 'Hi', text: 't' }, FROM)).not.toThrow();
195+
});
196+
197+
it('an absent subject or body is still the presence refusal, not a type refusal', () => {
198+
expect(refusal({ subject: null, text: 'x' })).toBe('VALIDATION_FAILED: subject is required');
199+
expect(refusal({ subject: 'x', text: null, html: null })).toBe('VALIDATION_FAILED: at least one of text or html is required');
200+
expect(refusal({ subject: 'x', text: '', html: '' })).toBe('VALIDATION_FAILED: at least one of text or html is required');
201+
});
202+
});
203+
124204
describe('LogTransport', () => {
125205
it('returns a synthetic Message-ID and logs', async () => {
126206
const logger = { info: vi.fn() };

‎packages/plugins/plugin-email/src/email-service.ts‎

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,45 @@ function listToArray(
344344
return arr.map((addr) => formatCallerAddress(addr, field));
345345
}
346346

347+
/** The message's text fields — each a string in `SendEmailInput`. */
348+
type MessageTextField = 'subject' | 'text' | 'html';
349+
350+
/** How a refusal names a value's JSON kind ("a number", "an array", …). */
351+
function kindOf(value: unknown): string {
352+
if (Array.isArray(value)) return 'an array';
353+
const kind = typeof value;
354+
return /^[aeiou]/.test(kind) ? `an ${kind}` : `a ${kind}`;
355+
}
356+
357+
/**
358+
* Refuse a text field that is present but not a string — the type
359+
* `SendEmailInput` already declares for it, judged where a JSON body can
360+
* carry any value.
361+
*
362+
* Without this, nothing typed these fields: `subject` was coerced with
363+
* `String()`, so an object sent a mail reading `Subject: [object Object]`, and
364+
* a non-string `text` / `html` passed the truthiness presence check and threw
365+
* inside the transport's stream, which `send` records as a delivery failure —
366+
* a `200 status: failed` for input the caller wrote. Refused here instead, as
367+
* `VALIDATION_FAILED` naming the field, before any `sys_email` delivery row or
368+
* transport call: the same refusal path, and so the same REST `400` and the
369+
* same `failed` rejection row ({@link EmailService.recordRejectedMessage}), as
370+
* a malformed recipient.
371+
*
372+
* `undefined` and `null` are absence, not a wrong type: whether an absent
373+
* field is acceptable stays the presence checks' question, exactly as before
374+
* (no subject is still "subject is required"; a `null` `text` beside a string
375+
* `html` still sends).
376+
*/
377+
function assertTextField(value: unknown, field: MessageTextField): void {
378+
if (value === undefined || value === null || typeof value === 'string') return;
379+
throw new Error(`VALIDATION_FAILED: \`${field}\` must be a string, not ${kindOf(value)}`);
380+
}
381+
347382
/**
348383
* Validate input + apply default-from + canonicalize recipients.
349384
* Throws Error('VALIDATION_FAILED: REASON') for malformed payloads — a
385+
* non-string `subject` / `text` / `html` ({@link assertTextField}) and a
350386
* malformed caller-supplied address (`to` / `cc` / `bcc` / `replyTo`)
351387
* included. An unsendable `from` is the one malformed address that is NOT a
352388
* `VALIDATION_FAILED`: see {@link formatCallerAddress}.
@@ -358,6 +394,9 @@ export function normalizeMessage(
358394
if (!input || typeof input !== 'object') {
359395
throw new Error('VALIDATION_FAILED: input must be an object');
360396
}
397+
assertTextField(input.subject, 'subject');
398+
assertTextField(input.text, 'text');
399+
assertTextField(input.html, 'html');
361400
const subject = String(input.subject ?? '').trim();
362401
if (!subject) throw new Error('VALIDATION_FAILED: subject is required');
363402
if (!input.text && !input.html) {
@@ -1005,7 +1044,7 @@ export class EmailService implements IEmailService {
10051044
/**
10061045
* Write the `sys_email` record for a message REJECTED before delivery —
10071046
* a `normalizeMessage` throw (bad/absent `from`, no recipient, no subject,
1008-
* no body).
1047+
* no body, a non-string `subject` / `text` / `html`).
10091048
*
10101049
* ## Why a row for something that was never sent
10111050
* `sys_email` is documented as the log of "every email the platform has
@@ -1043,7 +1082,12 @@ export class EmailService implements IEmailService {
10431082
...(rawAddressText(raw.cc) ? { cc_addresses: rawAddressText(raw.cc) } : {}),
10441083
...(rawAddressText(raw.bcc) ? { bcc_addresses: rawAddressText(raw.bcc) } : {}),
10451084
...(rawAddressText(raw.replyTo) ? { reply_to: rawAddressText(raw.replyTo) } : {}),
1046-
subject: String(raw.subject ?? '').trim() || UNSTATED_COLUMN,
1085+
// Only a string is recorded, as for the body columns below: a
1086+
// non-string subject is one of the refusals recorded here, and
1087+
// `String()` on it either invents `[object Object]` or THROWS (an object
1088+
// whose own `toString` is not callable), which would replace the
1089+
// caller's `VALIDATION_FAILED` with a TypeError — a 500, and no row.
1090+
subject: (typeof raw.subject === 'string' ? raw.subject.trim() : '') || UNSTATED_COLUMN,
10471091
...(typeof raw.text === 'string' ? { body_text: raw.text } : {}),
10481092
...(typeof raw.html === 'string' ? { body_html: raw.html } : {}),
10491093
...(raw.relatedObject ? { related_object: raw.relatedObject } : {}),

‎packages/rest/src/email-send-display-name.test.ts‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,62 @@ describe('POST /api/v1/email/send — a non-string recipient display name is the
160160
expect(out.body.status).toBe('sent');
161161
});
162162
});
163+
164+
describe('POST /api/v1/email/send — a non-string subject / text / html is the caller\'s 400, refused before the transport', () => {
165+
const NON_STRING: Array<[string, Record<string, unknown>, 'subject' | 'text' | 'html']> = [
166+
['`html: 123`', { subject: 'x', html: 123 }, 'html'],
167+
['`text: {a:1}`', { subject: 'x', text: { a: 1 } }, 'text'],
168+
['`subject: {a:1}`', { subject: { a: 1 }, html: 'hello' }, 'subject'],
169+
];
170+
171+
for (const [what, fields, field] of NON_STRING) {
172+
it(`${what}: 400 VALIDATION_FAILED naming \`${field}\`, and a failed rejection row`, async () => {
173+
const { post, rows } = await boot();
174+
const out = await post({ to: OK, ...fields });
175+
176+
expect(out.status).toBe(400);
177+
expect(out.body.code).toBe('VALIDATION_FAILED');
178+
expect(String(out.body.error).startsWith(`\`${field}\` `)).toBe(true);
179+
// Refused before delivery: the one row is the rejection record, never a
180+
// delivery attempt at `sent` / `failed` from the transport.
181+
expect(rows).toHaveLength(1);
182+
expect(rows[0].row).toMatchObject({ status: 'failed', attempt_count: 0 });
183+
expect(String(rows[0].row.error).startsWith('rejected before delivery: VALIDATION_FAILED: ')).toBe(true);
184+
});
185+
}
186+
187+
// `String()` THROWS on an object whose own `toString` is not callable; the
188+
// rejection row's writer must not coerce it, or the refusal becomes a 500
189+
// `EMAIL_SEND_FAILED` with no row.
190+
for (const [what, subject] of [
191+
['`subject: {toString: 1}`', { toString: 1 }],
192+
['`subject: [{toString: 1}]`', [{ toString: 1 }]],
193+
] as Array<[string, unknown]>) {
194+
it(`${what}: 400 VALIDATION_FAILED naming \`subject\`, and a failed rejection row`, async () => {
195+
const { post, rows } = await boot();
196+
const out = await post({ to: OK, subject, html: 'hello' });
197+
198+
expect(out.status).toBe(400);
199+
expect(out.body.code).toBe('VALIDATION_FAILED');
200+
expect(String(out.body.error).startsWith('`subject` ')).toBe(true);
201+
expect(rows).toHaveLength(1);
202+
expect(rows[0].row).toMatchObject({ status: 'failed', attempt_count: 0 });
203+
});
204+
}
205+
206+
it('CONTROL — a string subject and body still send (200 sent)', async () => {
207+
const { post } = await boot();
208+
const out = await post({ to: OK, subject: 'x', html: '<p>hello</p>', text: 'hello' });
209+
210+
expect(out.status).toBe(200);
211+
expect(out.body.status).toBe('sent');
212+
});
213+
214+
it('CONTROL — a `null` text beside a string html still sends, as an absent one does', async () => {
215+
const { post } = await boot();
216+
const out = await post({ to: OK, subject: 'x', html: '<p>hello</p>', text: null });
217+
218+
expect(out.status).toBe(200);
219+
expect(out.body.status).toBe('sent');
220+
});
221+
});

0 commit comments

Comments
 (0)