Commit 1d92ad1
bgagent
fix(fanout): emit fanout.slack.dup_delete_failed on ghost-message accumulation (aws-samples#79 review aws-samples#6)
The conditional UpdateItem dup-delete path
(``task_created`` / ``session_started`` lifecycle persists)
calls ``deleteMessage`` to clean up the duplicate Slack message
that landed when a sibling retry won the race. The delete is
inherently best-effort — but if it fails, the duplicate becomes a
permanent ghost in the thread and operators had no way to alarm
on the rate.
Refactor ``deleteMessage`` to return a boolean (``true`` on success
or ``message_not_found``-as-already-gone, ``false`` otherwise) and
emit a dedicated ``fanout.slack.dup_delete_failed`` event with an
``error_id: FANOUT_SLACK_DUP_DELETE_FAILED`` from the dup-delete
callsites when the cleanup couldn't complete.
The terminal-event cleanup paths (``slack_session_msg_ts``,
``slack_created_msg_ts``) intentionally don't fire this event —
those paths target genuinely-stale UX cleanup, not retry-driven
duplicates, so an alarm there would be noise.
No new tests beyond the existing dup-delete coverage; the
``deleteMessage`` return value isn't yet asserted at the unit
level, but the behavior is fully exercised by the existing
``dup-delete`` integration paths (test gap aws-samples#31 will add an
explicit failure-path assertion when it lands).1 parent fb88d4d commit 1d92ad1
1 file changed
Lines changed: 40 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
349 | 362 | | |
350 | 363 | | |
351 | 364 | | |
| |||
373 | 386 | | |
374 | 387 | | |
375 | 388 | | |
376 | | - | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
377 | 399 | | |
378 | 400 | | |
379 | 401 | | |
| |||
502 | 524 | | |
503 | 525 | | |
504 | 526 | | |
505 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
506 | 533 | | |
507 | 534 | | |
508 | 535 | | |
| |||
514 | 541 | | |
515 | 542 | | |
516 | 543 | | |
517 | | - | |
518 | | - | |
519 | | - | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
520 | 551 | | |
521 | 552 | | |
522 | 553 | | |
523 | 554 | | |
524 | 555 | | |
| 556 | + | |
525 | 557 | | |
| 558 | + | |
526 | 559 | | |
527 | 560 | | |
528 | 561 | | |
| |||
534 | 567 | | |
535 | 568 | | |
536 | 569 | | |
| 570 | + | |
537 | 571 | | |
538 | 572 | | |
0 commit comments