Repository navigation
Commit c5fdd08
authored
* fix(provider-microsoft): return structured failure when reply createReplyAll fails
When createReplyAll threw inside replyToMessage (e.g., the original message
was deleted and Graph returned 404), the catch fell through to a manual
sendMessage that used opts?.cc as `to:` and a literal `'Re: '` as subject.
The result was success: true with the email going to the wrong recipients
(or no one) and no thread context — silent mis-send.
Replace the silent fallback with a structured failure that mirrors
createReplyDraft:
{ success: false, error: { code: 'REPLY_FAILED', message, recoverable: false } }
A sendMail-based "fallback reply" is not actually a reply: it lacks
In-Reply-To / References headers so recipients' clients won't thread it,
and no amount of hydrating to/subject fixes that. Loud failure is correct;
the caller decides whether to send a fresh email.
Tests:
- Replace the broken-fallback scenario that asserted success: true.
- Add four failure-path tests covering createReplyAll throw, opts.cc
regression guard, /send failure after a successful PATCH, and PATCH
failure inside prepareReplyDraft.
Closes #50
* docs(spec): align provider-microsoft reply spec with new failure shape
Update the Draft-Then-Send via createReplyAll requirement to reflect that
replyToMessage now returns a structured REPLY_FAILED instead of silently
falling back to sendMail. Replace the stale "Fallback to sendMail on 404"
scenario with one that captures the new contract.
Spotted by Gemini and Codex during peer review of #54.
1 parent 816df6c commit c5fdd08
3 files changed
Lines changed: 71 additions & 27 deletions
File tree
- openspec/specs/provider-microsoft
- packages/provider-microsoft/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
Lines changed: 63 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
| 478 | + | |
479 | 479 | | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
| 480 | + | |
489 | 481 | | |
490 | 482 | | |
491 | 483 | | |
492 | 484 | | |
493 | 485 | | |
494 | | - | |
495 | | - | |
496 | | - | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
497 | 547 | | |
498 | 548 | | |
499 | 549 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
324 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
325 | 326 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | 327 | | |
335 | 328 | | |
336 | 329 | | |
| |||
0 commit comments