Support batched notifications#83
Draft
roznawsk wants to merge 2 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for Fishjam “batched” webhook notifications by teaching the SDK’s webhook decoder to unpack ServerMessageNotificationBatch, wiring a new room creation option to enable batching, and making the notification delivery path resilient to batches.
Changes:
- Add
RoomOptions.batch_webhook_notificationsand pass it through to the backend room config. - Extend
receive_binary()to return an ordered list when the payload is aServerMessageNotificationBatch. - Update notifier/test plumbing to handle batch-unpacked notifications and add tests around decoding batches.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
fishjam/_webhook_notifier.py |
Unpacks ServerMessageNotificationBatch and broadens receive_binary() return type to include lists. |
fishjam/_ws_notifier.py |
Robustly handles notification batches on the WebSocket path by unpacking and dispatching each notification. |
fishjam/api/_fishjam_client.py |
Adds batch_webhook_notifications to RoomOptions and forwards it into RoomConfig on room creation. |
tests/support/webhook_notifier.py |
Updates the test webhook server to enqueue each notification when receive_binary() returns a list. |
tests/test_webhook_notifier.py |
New unit tests validating receive_binary() behavior for single messages vs. batches (including filtering unsupported members). |
tests/test_notifier.py |
Adds an integration-style test that enables batched webhook notifications for a room. |
tests/test_allowed_notifications.py |
Clarifies that ServerMessageNotificationBatch is a transport wrapper that is unpacked by receive_binary(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+43
to
46
| def receive_binary( | ||
| binary: bytes, | ||
| ) -> Union[AllowedNotification, List[AllowedNotification], None]: | ||
| """Transforms a received protobuf notification into a notification instance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Describe your changes.
Motivation and Context
Why is this change required? What problem does it solve? If it fixes an open
issue, please link to the issue here.
Documentation impact
Types of changes
not work as expected)