livekit / client-sdk-unity-web

Official LiveKit SDK for Unity WebGL
https://livekit.io
Apache License 2.0
54 stars 20 forks source link

LocalParticipant.SetAttributes does not work in v2.0 SDK. Attributes are never applied. #64

Open chuckills opened 1 week ago

chuckills commented 1 week ago

SDK v2.0.1 Unity v6000.0.23f1

Trying to add new attributes to the LocalParticipant fails.

Calling a count of the participant attributes and new attribute JSMap argument using the following snippet produces the output at bottom of the post, which seems like something is wrong with the underlying object

Debug.Log($"Participant.attributes count before: {Participant.attributes.Count}");
JSMap<string, string> attributes = new JSMap<string, string>();
attributes.Add("MyAttribute", "myValue");
Debug.Log($"attributes count: {attributes.Count}");
yield return Participant.SetAttributes(attributes);
Debug.Log($"Participant.attributes count after: {Participant.attributes.Count}");

This is the output:

Participant.attributes count before: -2147483648
attributes count: 1
Participant.attributes count after: -2147483648