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

"There is no value in the ParticipantDevice enum that corresponds to 'win 11'." #354

Closed
cropter123 opened this issue Jul 21, 2024 · 10 comments
Assignees
Labels
Bug This change resolves a defect
Milestone

Comments

@cropter123
Copy link

cropter123 commented Jul 21, 2024

var participants = mZoomClient.Dashboards.GetMeetingParticipantsAsync(meeting.Id.ToString()).Result;

Used to work just fine, today it started failing with following stack trace. Look like ParticipantDeviceConverter is missing the the handling of device: win 11. Is there any quick workaround?

"There is no value in the ParticipantDevice enum that corresponds to 'win 11'."
   at ZoomNet.Internal.ToEnum[T](String str)
   at ZoomNet.Json.ParticipantDeviceConverter.Convert(String deviceAsString)
   at ZoomNet.Json.ParticipantDeviceConverter.<>c.<Read>b__0_0(String item)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at ZoomNet.Json.ParticipantDeviceConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.PopulatePropertiesFastPath(Object obj, JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& state)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.Converters.JsonMetadataServicesConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.JsonCollectionConverter`2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value)
   at System.Text.Json.Serialization.Converters.JsonMetadataServicesConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 utf8Json, JsonTypeInfo`1 jsonTypeInfo, Nullable`1 actualByteCount)
   at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 json, JsonTypeInfo`1 jsonTypeInfo)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
   at ZoomNet.Internal.ToObject[T](JsonElement element, JsonSerializerOptions options)
   at ZoomNet.Internal.<AsPaginatedResponseWithToken>d__52`1.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ZoomNet.Internal.<AsPaginatedResponseWithToken>d__14`1.MoveNext()

Originally posted by @cropter123 in #353

@Jericho Jericho self-assigned this Jul 22, 2024
@Jericho Jericho added the Bug This change resolves a defect label Jul 22, 2024
@Jericho Jericho added this to the 0.79.0 milestone Jul 22, 2024
@Jericho
Copy link
Owner

Jericho commented Jul 22, 2024

We have seen this problem before (here, here and here). The issue is that Zoom, from time to time, adds new values to the "participant device" enum without documenting these changes which causes the ZoomNet library to fail when attempting to parse the undocumented value. The new value you just discovered (which is win 11) is the third (that I know of) that represents a Windows based device. The documentation mentions windows as being the official value for a Windows based device but some developers have reported WIN being used in some cases and now, you have witnessed win 11 being used in some cases. Very confusing indeed!

Anyway, long story short: the solution is to add this new value to the list of possible value that represent a Windows based device in the ZoomNet library so that our participant device converter knows how to deal with this value.

I was already planning a new release in the next few days, so this issue should be fixed shortly.

@cropter123
Copy link
Author

Thank you for clarifying it. I forked the branch and added win 11 to the enum list then discovered next device value which is just a number. I ended up removing the throw statement in line 801 in Internal.cs and just return default(T). That bypassed the issue for me.

	internal static T ToEnum<T>(this string str) where T : Enum
	{
		if (str.TryToEnum(out T enumValue)) return enumValue;

		return default(T);
		//throw new ArgumentException($"There is no value in the {typeof(T).Name} enum that corresponds to '{str}'.");
	}

@Jericho
Copy link
Owner

Jericho commented Jul 22, 2024

discovered next device value which is just a number.

Can you please elaborate what you mean? Are you saying Zoom returned a number instead of a string such as "windows"?

Can you share the JSON payload you receive from the APIso I can reproduce your scenario?

@cropter123
Copy link
Author

cropter123 commented Jul 22, 2024

Besides "win 11", it also has "win 10" and if handled both, it fails on "17763"

Looking at the raw json response, it looks like because device is "win 10+ 17763"

{
  "id":"MercKjkyQMCa3eTEXYeObQ",
  "user_id":"16778240",
  "participant_uuid":"1B2551FE-F292-3F4D-756B-1300A102125C",
  "user_name":"iL9",
  "device":"win 10+ 17763",
  "ip_address":"31.44.5.60",
  "internal_ip_addresses":["31.44.*.*"],
  "location":"(US)",
  "network_type":"Wired",
  "data_center":"Netherlands (AMS Top)",
  "full_data_center":"Netherlands (AMS Top);",
  "connection_type":"Reliable UDP",
  "join_time":"2024-07-22T20:42:06Z",
  "share_application":false,
  "share_desktop":false,
  "share_whiteboard":false,
  "recording":false,
  "pc_name":"AX-VHOST03",
  "domain":"",
  "mac_addr":"ca02-bf82-a61a",
  "harddisk_id":"VirtIO:BHYVE-CEBF-C97F-EA99;",
  "version":"6.0.11.39959",
  "email":"ilearning.classroom9@gmail.com",
  "registrant_id":"",
  "status":"in_meeting",
  "os":"win",
  "os_version":"\\"10+ 17763\\"",
  "device_name":"",
  "groupId":"",
  "customer_key":"",
  "sip_uri":"",
  "from_sip_uri":"",
  "role":"host",
  "participant_user_id":"MercKjkyQMCa3eTEXYeObQ",
  "audio_call":[]
}

@Jericho
Copy link
Owner

Jericho commented Jul 22, 2024

Do you know what 17763 represents?

@cropter123
Copy link
Author

17763 seems to be a windows 10 build number. Full device name "win 10+ 17763" I think the + messed up the parsing somehow so it tries to read win 10 and 17763 as 2 separate device names

@Jericho
Copy link
Owner

Jericho commented Jul 23, 2024

Looks like you're right, 17763 is indeed a build number for windows 10.

What this tells me is that sometimes the '+' symbol is used as a delimiter between two distinct values like this example: "device": "Unknown + Phone". This is something that was brought to my attention in #168 back in February 2022. In that issue, I hypothesized that the divider separates the devices used to connect to the video feed and the device used to connect to the audio feed.

However, in the scenario that you are bringing to my attention today, the '+' symbol is used for a different purpose. It's used to separate the enum value representing a device ("win 11" in your example) and the OS build number.

So, not only do I need to add "win 10" and "win 11" to the DeviceParticipant enum, I also must improve the ParticipantDeviceConverter to be able to handle OS build numbers.

@Jericho
Copy link
Owner

Jericho commented Jul 23, 2024

What's even more confusing is there are two new nodes in the JSON you provided (thanks for that by the way). os and os_version which contain the name and version of the operating system. The device node seems to be a duplicate of this information.

The os and os_version node are new (to me anyway), I'll make sure to add them to our Participant model class.

@Jericho
Copy link
Owner

Jericho commented Jul 23, 2024

I'm preparing to release 0.79.0 which will include this enhancement.

@Jericho Jericho closed this as completed Jul 23, 2024
@Jericho
Copy link
Owner

Jericho commented Jul 23, 2024

🎉 This issue has been resolved in version 0.79.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This change resolves a defect
Projects
None yet
Development

No branches or pull requests

2 participants