Skip to content

Comments

fix(crossseed): avoid webhook notification spam on pending matches#1496

Merged
s0up4200 merged 2 commits intodevelopfrom
codex/fix-webhook-pending-notify
Feb 22, 2026
Merged

fix(crossseed): avoid webhook notification spam on pending matches#1496
s0up4200 merged 2 commits intodevelopfrom
codex/fix-webhook-pending-notify

Conversation

@s0up4200
Copy link
Collaborator

@s0up4200 s0up4200 commented Feb 22, 2026

Summary

  • stop emitting webhook success notifications when all matches are still pending
  • keep notifications for complete matches only
  • add regression coverage for pending-only vs complete-match notification behavior

Validation run: go test -race -count=3 ./internal/services/crossseed -run 'TestCheckWebhook_(AutobrrPayload|NotificationRequiresCompleteMatch)$'; make test; make lint (backend lint passed, frontend lint blocked in this env because web/node_modules is missing and eslint is unavailable).

Summary by CodeRabbit

  • Bug Fixes

    • Webhook notifications now only trigger when cross-seed matches reach completion, preventing notifications from being sent for partial or pending match states.
  • Tests

    • Implemented comprehensive webhook notification behavior tests, validating that notifications are correctly emitted for complete matches while remaining suppressed for pending scenarios.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Modified cross-seed webhook notification behavior to emit notifications only when complete matches exist, preventing notifications for partial/pending matches. Added test coverage with a recording notifier mechanism to validate notification emission logic.

Changes

Cohort / File(s) Summary
Webhook Notification Logic
internal/services/crossseed/service.go
Added early return in notifyWebhookCheck when completeCount is zero, preventing webhook notifications from being sent for checks without fully completed matches.
Webhook Notification Tests
internal/services/crossseed/crossseed_test.go
Introduced recordingNotifier test utility to capture notifications during test execution. Added TestCheckWebhook_NotificationRequiresCompleteMatch to verify notifications emit only on complete matches, and extended TestCheckWebhook_AutobrrPayload with notification validation scenarios.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

bugfix, cross-seed

Poem

🐰 A webhook once whispered in haste,
Notifying of matches half-baked, not-tasted,
But this clever fix makes it wait,
Till the match is complete—oh, how great!
Now notifications arrive just right. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: preventing webhook notifications from being sent for pending matches only, which aligns with the core fix of returning early when completeCount == 0.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/fix-webhook-pending-notify

Comment @coderabbitai help to get the list of available commands and usage tips.

@s0up4200 s0up4200 merged commit 9fdc949 into develop Feb 22, 2026
5 checks passed
@s0up4200 s0up4200 deleted the codex/fix-webhook-pending-notify branch February 22, 2026 10:37
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