Skip to content

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

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

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

Conversation

@s0up4200

@s0up4200 s0up4200 commented Feb 22, 2026

Copy link
Copy Markdown
Collaborator

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

coderabbitai Bot commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

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
alexlebens pushed a commit to alexlebens/infrastructure that referenced this pull request Feb 24, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/autobrr/qui](https://github.com/autobrr/qui) | patch | `v1.14.0` → `v1.14.1` |

---

### Release Notes

<details>
<summary>autobrr/qui (ghcr.io/autobrr/qui)</summary>

### [`v1.14.1`](https://github.com/autobrr/qui/releases/tag/v1.14.1)

[Compare Source](autobrr/qui@v1.14.0...v1.14.1)

#### Changelog

##### Bug Fixes

- [`6f3171c`](autobrr/qui@6f3171c): fix(auth): avoid chromium basic auth resets on expired qui sessions ([#&#8203;1495](autobrr/qui#1495)) ([@&#8203;s0up4200](https://github.com/s0up4200))
- [`d5acab7`](autobrr/qui@d5acab7): fix(automations): make managed full tag sync idempotent ([#&#8203;1494](autobrr/qui#1494)) ([@&#8203;s0up4200](https://github.com/s0up4200))
- [`9fdc949`](autobrr/qui@9fdc949): fix(crossseed): avoid webhook notification spam on pending matches ([#&#8203;1496](autobrr/qui#1496)) ([@&#8203;s0up4200](https://github.com/s0up4200))
- [`350edb3`](autobrr/qui@350edb3): fix(notifications): improve torrent and automation event samples ([#&#8203;1501](autobrr/qui#1501)) ([@&#8203;s0up4200](https://github.com/s0up4200))
- [`e2c032c`](autobrr/qui@e2c032c): fix(qbittorrent): ignore pseudo tracker labels in domain parsing ([#&#8203;1489](autobrr/qui#1489)) ([@&#8203;s0up4200](https://github.com/s0up4200))
- [`e00c70d`](autobrr/qui@e00c70d): fix(qbittorrent): repair unified torrent sorting ([#&#8203;1490](autobrr/qui#1490)) ([@&#8203;s0up4200](https://github.com/s0up4200))
- [`4d95325`](autobrr/qui@4d95325): fix(themes): clarify crypto donation discount flow ([#&#8203;1503](autobrr/qui#1503)) ([@&#8203;s0up4200](https://github.com/s0up4200))
- [`579ea8d`](autobrr/qui@579ea8d): fix(themes): clarify premium checkout and crypto flow ([@&#8203;s0up4200](https://github.com/s0up4200))
- [`ece956a`](autobrr/qui@ece956a): fix(torrents): scope instance column to unified cross-instance data ([#&#8203;1502](autobrr/qui#1502)) ([@&#8203;s0up4200](https://github.com/s0up4200))
- [`27cf6d2`](autobrr/qui@27cf6d2): fix(ui): hide unified entry when one instance is active ([#&#8203;1493](autobrr/qui#1493)) ([@&#8203;s0up4200](https://github.com/s0up4200))
- [`80d911f`](autobrr/qui@80d911f): fix(ui): remove single-instance indent in header menu ([@&#8203;s0up4200](https://github.com/s0up4200))
- [`6ae7625`](autobrr/qui@6ae7625): fix(ui): restore instances header in menu ([@&#8203;s0up4200](https://github.com/s0up4200))

##### Other Changes

- [`336dc9a`](autobrr/qui@336dc9a): docs: update payment info ([#&#8203;1424](autobrr/qui#1424)) ([@&#8203;s0up4200](https://github.com/s0up4200))

**Full Changelog**: <autobrr/qui@v1.14.0...v1.14.1>

#### Docker images

- `docker pull ghcr.io/autobrr/qui:v1.14.1`
- `docker pull ghcr.io/autobrr/qui:latest`

#### What to do next?

- Join our [Discord server](https://discord.autobrr.com/qui)

Thank you for using qui!

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNS43IiwidXBkYXRlZEluVmVyIjoiNDMuMjUuNyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiYXV0b21lcmdlIiwiaW1hZ2UiXX0=-->

Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/4187
Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net>
Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
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