send_email's error path has no test: discarding the builder's Result reds nothing #31

Closed
opened 2026-08-29 14:27:15 +00:00 by jlxq0 · 0 comments
Owner

build_email_object now validates internally and returns Result, so the guard cannot be omitted. Its error can still be discarded at the call site and no test notices.

src/mcp.rs:1434
build_email_object(&params, &drafts, &from.header())?
  ->  .unwrap_or_else(|_| json!({}))

187 passed; 0 failed

Confirmed twice, by the jmap-mcp lead and again by me before merging #30.

Closing it needs a test that drives send_email itself. The handler takes a RequestContext<RoleServer> and fabricating one is a harness rather than a few lines, which is why it is here and not in #30.

The class this belongs to, and the reason it was invisible: a mutation set that only edits function bodies cannot see whether the function is called. #30's first four mutations were each red on exactly one test and every one pointed a layer below the fault. Mutate the call site as well as the callee, and when a mutation reds nothing, say so rather than dropping it.

`build_email_object` now validates internally and returns `Result`, so the guard cannot be omitted. Its error can still be discarded at the call site and no test notices. src/mcp.rs:1434 build_email_object(&params, &drafts, &from.header())? -> .unwrap_or_else(|_| json!({})) 187 passed; 0 failed Confirmed twice, by the jmap-mcp lead and again by me before merging `#30`. Closing it needs a test that drives `send_email` itself. The handler takes a `RequestContext<RoleServer>` and fabricating one is a harness rather than a few lines, which is why it is here and not in `#30`. **The class this belongs to**, and the reason it was invisible: a mutation set that only edits function bodies cannot see whether the function is called. `#30`'s first four mutations were each red on exactly one test and every one pointed a layer below the fault. Mutate the call site as well as the callee, and when a mutation reds nothing, say so rather than dropping it.
jlxq0 closed this issue 2026-09-01 18:03:51 +00:00
Sign in to join this conversation.
No labels
waiting-on-julian
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jlxq0/jmap-mcp#31
No description provided.