Skip to content

WPB-28421 add an opt in policy for dropping unsupported federated notifications - #5501

Open
battermann wants to merge 2 commits into
developfrom
WPB-28421-backend-add-an-opt-in-policy-for-dropping-unsupported-federated-notifications
Open

WPB-28421 add an opt in policy for dropping unsupported federated notifications#5501
battermann wants to merge 2 commits into
developfrom
WPB-28421-backend-add-an-opt-in-policy-for-dropping-unsupported-federated-notifications

Conversation

@battermann

@battermann battermann commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

https://wearezeta.atlassian.net/browse/WPB-28421

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@battermann
battermann marked this pull request as ready for review September 1, 2026 10:20
@battermann
battermann requested review from a team as code owners September 1, 2026 10:20
@battermann
battermann requested a lite review from Copilot September 1, 2026 10:22
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Sep 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces an opt-in per-message policy for how the background worker should handle federated backend-notification bundles when there is no common federation API version with the target backend. It extends the RabbitMQ payload format in a backward-compatible way (defaulting to the safe “keep queued” behavior) while enabling producers to explicitly request dropping unsupported notifications.

Changes:

  • Add UnsupportedVersionPolicy and extend PayloadBundle with an optional unsupportedVersionPolicy field (defaults to KeepQueued on decode).
  • Update the background worker pusher to either keep the message queued (and mark the queue as stuck) or ack+count-drop based on the policy.
  • Add Prometheus metric wire_backend_notifications_dropped_unsupported_version and extend tests to cover default/combination behavior and drop-vs-keep behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
services/background-worker/test/Test/Wire/BackendNotificationPusherSpec.hs Adds coverage for payload bundle defaulting/semigroup behavior and pushNotification behavior for unsupported versions under both policies.
services/background-worker/src/Wire/BackgroundWorker/Env.hs Adds a new Prometheus counter for dropped-unsupported-version notifications.
services/background-worker/src/Wire/BackendNotificationPusher.hs Implements policy-driven behavior when no compatible API version exists (keep queued vs drop+ack), and updates metrics/gauge accordingly.
libs/wire-api-federation/src/Wire/API/Federation/BackendNotifications.hs Introduces UnsupportedVersionPolicy, extends PayloadBundle schema with a backward-compatible optional field, and defines safe Semigroup behavior.
changelog.d/6-federation/WPB-28421 Changelog entry for the new opt-in drop policy.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@battermann
battermann force-pushed the WPB-28421-backend-add-an-opt-in-policy-for-dropping-unsupported-federated-notifications branch from 8263832 to 95c63ed Compare September 1, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants