Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FBS: LayersChangeNotification body must be optional #1227

Merged
merged 3 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions rust/src/router/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,11 +621,15 @@ impl Notification {
panic!("Wrong message from worker: {notification:?}");
};

let layers_fbs =
consumer::ConsumerLayers::try_from(body.layers().unwrap()).unwrap();
let layers = ConsumerLayers::from_fbs(layers_fbs);
match body.layers().unwrap() {
Some(layers) => {
let layers_fbs = consumer::ConsumerLayers::try_from(layers).unwrap();
let layers = ConsumerLayers::from_fbs(layers_fbs);

Ok(Notification::LayersChange(Some(layers)))
Ok(Notification::LayersChange(Some(layers)))
}
None => Ok(Notification::LayersChange(None)),
}
}
notification::Event::ConsumerTrace => {
let Ok(Some(notification::BodyRef::ConsumerTraceNotification(body))) =
Expand Down
2 changes: 1 addition & 1 deletion worker/fbs/consumer.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ table GetStatsResponse {
// Notifications from Worker.

table LayersChangeNotification {
layers: ConsumerLayers (required);
layers: ConsumerLayers;
}

table RtpNotification {
Expand Down