@@ -27,7 +27,7 @@ const (
2727)
2828
2929// AddRoom creates a new room entry in the NATS JetStream Key-Value store
30- func (s * NatsService ) AddRoom (tableId uint64 , roomId , roomSid string , emptyTimeout , maxParticipants * uint32 , metadata * plugnmeet.RoomMetadata ) error {
30+ func (s * NatsService ) AddRoom (tableId uint64 , roomId , roomSid string , emptyTimeout , maxParticipants * uint32 , metadata * plugnmeet.RoomMetadata ) ( string , error ) {
3131 // Create or update the key-value bucket for the room
3232 bucket := s .formatConsolidatedRoomBucket (roomId )
3333 kv , err := s .js .CreateOrUpdateKeyValue (s .ctx , jetstream.KeyValueConfig {
@@ -36,7 +36,7 @@ func (s *NatsService) AddRoom(tableId uint64, roomId, roomSid string, emptyTimeo
3636 TTL : DefaultTTL ,
3737 })
3838 if err != nil {
39- return fmt .Errorf ("failed to create or update KV bucket: %w" , err )
39+ return "" , fmt .Errorf ("failed to create or update KV bucket: %w" , err )
4040 }
4141
4242 // Set default values if not provided
@@ -52,7 +52,7 @@ func (s *NatsService) AddRoom(tableId uint64, roomId, roomSid string, emptyTimeo
5252 // Marshal metadata to string
5353 mt , err := s .MarshalRoomMetadata (metadata )
5454 if err != nil {
55- return fmt .Errorf ("failed to marshal metadata: %w" , err )
55+ return "" , fmt .Errorf ("failed to marshal metadata: %w" , err )
5656 }
5757
5858 // Prepare room data
@@ -70,12 +70,12 @@ func (s *NatsService) AddRoom(tableId uint64, roomId, roomSid string, emptyTimeo
7070 // Store each key-value pair
7171 for k , v := range data {
7272 if _ , err := kv .PutString (s .ctx , k , v ); err != nil {
73- return fmt .Errorf ("failed to store room data for key %s: %w" , k , err )
73+ return "" , fmt .Errorf ("failed to store room data for key %s: %w" , k , err )
7474 }
7575 }
7676 // add room to watcher
7777 s .cs .addRoomWatcher (kv , bucket , roomId )
78- return nil
78+ return mt , nil
7979}
8080
8181// updateRoomMetadata updates the metadata of an existing room
0 commit comments