I am calling CreateRoomAsync, passing in a RoomCreationOptions to specify a tag and setting FindOrCreate to true so it should return an existing room if there is one. Instead it always returns a new room. It appears the value of FindOrCreate is ignored and always false in the coherence code?
var options = new RoomCreationOptions
{
Tags = new[] { _gameModel._id },
FindOrCreate = true,
};
var room = await MenuController.Instance.RoomService.CreateRoomAsync(options);
Expected behaviour
The system should find a room with a matching tag and return the existing room.
Screenshots
How to reproduce
Every time
- Call CreateRoomAsync with a string tag, and FindOrCreate = true
- Call CreateRoomAsync again with same tag, and FindOrCreate = true
See in room dashboard that it created a second room with same tag, instead of returning existing room.
I found that in CloudRoomsService.cs code it looks like FindOrCreate is hard coded to false on line 504 instead of copying the value from options passed in?
private string GetRoomCreationRequestBody(RoomCreationOptions roomCreationOptions)
{
var requestBody = Utils.CoherenceJson.SerializeObject(new RoomCreationRequest()
{
Tags = roomCreationOptions.Tags ?? new string[] { },
KV =roomCreationOptions.KeyValues ?? new Dictionary<string, string>(),
Region = region,
MaxClients = roomCreationOptions.MaxClients,
SimSlug = runtimeSettings.SimulatorSlug,
FindOrCreate = false
});
return requestBody;
}
Environment
SDK: 1.1.4
Unity: 2022.3.19
OS/Platform: MacOS