Skip to content

Commit b721d7d

Browse files
update balancer to accept json values for room metadata (#1452)
* updated room metadata to accept json values * updated generate_random_metadata to use json values * update types in monolith * made requested changes * add back deleted attributes
1 parent 1137ce7 commit b721d7d

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

crates/ott-balancer-protocol/src/monolith.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -206,17 +206,23 @@ where
206206
/// Metadata about a room, according to the Monolith.
207207
pub struct RoomMetadata {
208208
pub name: RoomName,
209-
pub title: String,
210-
pub description: String,
209+
#[typeshare(serialized_as = "unknown")]
210+
pub title: serde_json::Value,
211+
#[typeshare(serialized_as = "unknown")]
212+
pub description: serde_json::Value,
211213
#[serde(rename = "isTemporary")]
212-
pub is_temporary: bool,
214+
#[typeshare(serialized_as = "unknown")]
215+
pub is_temporary: serde_json::Value,
213216
pub visibility: Visibility,
214217
#[serde(rename = "queueMode")]
215-
pub queue_mode: String,
218+
#[typeshare(serialized_as = "unknown")]
219+
pub queue_mode: serde_json::Value,
216220
#[serde(rename = "currentSource")]
221+
#[typeshare(serialized_as = "unknown")]
217222
pub current_source: serde_json::Value,
218223
/// The number of clients in this room.
219-
pub users: u32,
224+
#[typeshare(serialized_as = "unknown")]
225+
pub users: serde_json::Value,
220226
}
221227

222228
impl RoomMetadata {

server/generated.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ export enum Visibility {
5151
/** Metadata about a room, according to the Monolith. */
5252
export interface RoomMetadata {
5353
name: RoomName;
54-
title: string;
55-
description: string;
56-
isTemporary: boolean;
54+
title: unknown;
55+
description: unknown;
56+
isTemporary: unknown;
5757
visibility: Visibility;
58-
queueMode: string;
58+
queueMode: unknown;
5959
currentSource: unknown;
6060
/** The number of clients in this room. */
61-
users: number;
61+
users: unknown;
6262
}
6363

6464
export interface M2BLoaded {

tools/balancer-tester/src/monolith.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ pub struct SimpleEcho {
154154
fn generate_random_metadata(room: &RoomName) -> RoomMetadata {
155155
RoomMetadata {
156156
name: room.clone(),
157-
title: "foo".to_string(),
158-
description: "foo".to_string(),
159-
is_temporary: false,
157+
title: serde_json::Value::String("foo".to_string()),
158+
description: serde_json::Value::String("foo".to_string()),
159+
is_temporary: serde_json::Value::Bool(false),
160160
visibility: Visibility::Public,
161-
queue_mode: "manual".to_string(),
161+
queue_mode: serde_json::Value::String("manual".to_string()),
162162
current_source: serde_json::Value::Null,
163-
users: 2,
163+
users: serde_json::Value::Number(2.into()),
164164
}
165165
}

0 commit comments

Comments
 (0)