Skip to content

Fix Discord/DiscordDm reporting success on partial failure#7

Merged
MikeWills merged 2 commits into
masterfrom
fix/discord-partial-failure-reporting
Jul 8, 2026
Merged

Fix Discord/DiscordDm reporting success on partial failure#7
MikeWills merged 2 commits into
masterfrom
fix/discord-partial-failure-reporting

Conversation

@MikeWills

Copy link
Copy Markdown
Owner

Summary

  • DiscordService.SendAsync and DiscordDmService.SendToAllUsersAsync both used results.Any(r => r) across per-recipient send results, so if only 1 of N webhooks/DM recipients succeeded, the whole post was reported as an overall success — the orchestrator's "Delivery was not successful" warning never fires for a real partial failure.
  • TwilioService and VoipMsService use .All(r => r) for the structurally identical multi-recipient pattern. Aligned Discord and DiscordDm with that.

Test plan

  • Config with 2+ webhook URLs / user IDs where one is intentionally broken; confirm PostAlertAsync now returns false and the failure is logged, instead of silently reporting success

…ilure

Both used Any() across per-recipient results, so if 1 of N webhooks/DMs
succeeded the whole post was reported as a success and the orchestrator's
failure warning never logged. Twilio and VoIP.ms use All() for the same
multi-recipient pattern; align Discord and DiscordDm with that.
Comment on lines 77 to +79
var tasks = _settings.UserIds.Select(userId => SendToUserAsync(userId, content, embed, label, imageBytes));
var results = await Task.WhenAll(tasks);
return results.Any(r => r);
return results.All(r => r);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLAUDE.md compliance: this PR is a behavior-changing bug fix (here and in Services/DiscordService.cs#L67-L71, aggregate success now requires all recipients to succeed instead of any), but includes no README.md update.

Root CLAUDE.md, Non-Negotiable Rule #1 ("Always update README.md"):

Any change — new feature, new service, new config field, behavior change, bug fix — must include a corresponding README.md update. ... If unsure which section to update, add a note under ## Recent Changes at the bottom.

The README's ## Recent Changes section already documents comparable backend bug fixes (e.g. the VoIP.ms GET-vs-POST fix, the SPC MCD polygon parsing fix) — please add a similar bullet describing this fix.

Per CLAUDE.md Non-Negotiable Rule #1, caught by the claude-code-review
bot's inline comment on this PR.
@MikeWills
MikeWills merged commit 42d8b66 into master Jul 8, 2026
1 check passed
@MikeWills
MikeWills deleted the fix/discord-partial-failure-reporting branch July 8, 2026 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant