Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions doc/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
- [ServerMessage.HlsPlayable](#fishjam-ServerMessage-HlsPlayable)
- [ServerMessage.HlsUploadCrashed](#fishjam-ServerMessage-HlsUploadCrashed)
- [ServerMessage.HlsUploaded](#fishjam-ServerMessage-HlsUploaded)
- [ServerMessage.NotificationBatch](#fishjam-ServerMessage-NotificationBatch)
- [ServerMessage.PeerAdded](#fishjam-ServerMessage-PeerAdded)
- [ServerMessage.PeerConnected](#fishjam-ServerMessage-PeerConnected)
- [ServerMessage.PeerCrashed](#fishjam-ServerMessage-PeerCrashed)
Expand Down Expand Up @@ -1363,6 +1364,7 @@ Defines any type of message passed between FJ and server peer
| viewer_disconnected | [ServerMessage.ViewerDisconnected](#fishjam-ServerMessage-ViewerDisconnected) | | |
| streamer_connected | [ServerMessage.StreamerConnected](#fishjam-ServerMessage-StreamerConnected) | | |
| streamer_disconnected | [ServerMessage.StreamerDisconnected](#fishjam-ServerMessage-StreamerDisconnected) | | |
| notification_batch | [ServerMessage.NotificationBatch](#fishjam-ServerMessage-NotificationBatch) | | Batch |
| stream_connected | [ServerMessage.StreamConnected](#fishjam-ServerMessage-StreamConnected) | | **Deprecated.** |
| stream_disconnected | [ServerMessage.StreamDisconnected](#fishjam-ServerMessage-StreamDisconnected) | | **Deprecated.** |
| hls_playable | [ServerMessage.HlsPlayable](#fishjam-ServerMessage-HlsPlayable) | | **Deprecated.** |
Expand Down Expand Up @@ -1498,6 +1500,31 @@ Notification sent when the HLS recording is successfully uploaded to AWS S3



<a name="fishjam-ServerMessage-NotificationBatch"></a>

### ServerMessage.NotificationBatch
Carries multiple notifications in a single wire frame.

Constraints (documented, not schema-enforced):
- Each element&#39;s `content` MUST be a notification variant — never
Authenticated, AuthRequest, SubscribeRequest, or SubscribeResponse.
- NotificationBatch MUST NOT be nested inside another NotificationBatch.
The schema technically permits this, but senders must not emit
recursive batches and receivers may treat them as a protocol violation.
- Notifications are delivered in array order; consumers must process
them in order.
- Sent only for webhooks, for peers that .


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| notifications | [ServerMessage](#fishjam-ServerMessage) | repeated | |






<a name="fishjam-ServerMessage-PeerAdded"></a>

### ServerMessage.PeerAdded
Expand Down
18 changes: 18 additions & 0 deletions fishjam/server_notifications.proto
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,21 @@ message ServerMessage {
string streamer_id = 2;
}

// Carries multiple notifications in a single wire frame.
//
// Constraints (documented, not schema-enforced):
// - Each element's `content` MUST be a notification variant — never
// Authenticated, AuthRequest, SubscribeRequest, or SubscribeResponse.
// - NotificationBatch MUST NOT be nested inside another NotificationBatch.
// The schema technically permits this, but senders must not emit
// recursive batches and receivers may treat them as a protocol violation.
// - Notifications are delivered in array order; consumers must process
// them in order.
// - Sent only for webhooks, for peers that .
message NotificationBatch {
repeated ServerMessage notifications = 1;
}

reserved 12;

oneof content {
Expand Down Expand Up @@ -273,6 +288,9 @@ message ServerMessage {
StreamerConnected streamer_connected = 26;
StreamerDisconnected streamer_disconnected = 27;

// Batch
NotificationBatch notification_batch = 33;

// Deprecated

StreamConnected stream_connected = 22 [deprecated = true];
Expand Down
16 changes: 16 additions & 0 deletions fishjam_protos/lib/fishjam/server_notifications.pb.ex
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,17 @@ defmodule Fishjam.ServerMessage.StreamerDisconnected do
field :streamer_id, 2, type: :string, json_name: "streamerId"
end

defmodule Fishjam.ServerMessage.NotificationBatch do
@moduledoc false

use Protobuf,
full_name: "fishjam.ServerMessage.NotificationBatch",
protoc_gen_elixir_version: "0.16.0",
syntax: :proto3

field :notifications, 1, repeated: true, type: Fishjam.ServerMessage
end

defmodule Fishjam.ServerMessage do
@moduledoc false

Expand Down Expand Up @@ -572,6 +583,11 @@ defmodule Fishjam.ServerMessage do
json_name: "streamerDisconnected",
oneof: 0

field :notification_batch, 33,
type: Fishjam.ServerMessage.NotificationBatch,
json_name: "notificationBatch",
oneof: 0

field :stream_connected, 22,
type: Fishjam.ServerMessage.StreamConnected,
json_name: "streamConnected",
Expand Down
10 changes: 10 additions & 0 deletions prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -e
Comment thread
roznawsk marked this conversation as resolved.

find fishjam -name "*.proto" | sort | xargs docker run --rm -v $PWD/doc:/out -v $PWD:/protos pseudomuto/protoc-gen-doc --doc_opt=markdown,docs.md

buf format -w
buf lint

(cd ./fishjam_protos; ./compile_proto.sh)
Loading