World/Udon Bugs & Feature Requests

Post about current World or Udon bugs feature requests. One item per post!
Non-constructive and off-topic posts will be moved or deleted.
[1896] VRCJson.TryDeserializeFromJson may incorrectly parse braces in strings inside nested objects
Tested with VRChat client build 1896. I would like to report an issue with VRCJson.TryDeserializeFromJson. There appear to be cases where valid JSON fails to deserialize when an object is nested two or more levels deep and a string inside the nested object contains a brace character ( { or } ). The exact behavior appears to depend on the nesting depth and the brace character. It is not the case that every brace inside every nested object fails. For example, a closing brace ( } ) inside a string at the third nesting level can deserialize successfully. Braces inside JSON strings should always be treated as ordinary string characters and should not affect the surrounding object structure. The following valid JSON objects fail to deserialize: { "x": { "y": "{" } } { "x": { "y": "}" } } { "x": { "y": { "z": "{" } } } Reproduction code: string json1 = @"{ ""x"": { ""y"": ""{"" } }"; bool success1 = VRCJson.TryDeserializeFromJson(json1, out DataToken result1); Debug.Log(success1); Debug.Log(result1.ToString()); // Expected: true // Actual: false // // UnableToParse: Unable to Deserialize from Json: // Found end of string before finishing object string json2 = @"{ ""x"": { ""y"": ""}"" } }"; bool success2 = VRCJson.TryDeserializeFromJson(json2, out DataToken result2); Debug.Log(success2); Debug.Log(result2.ToString()); // Expected: true // Actual: false // // UnableToParse: Unable to Deserialize from Json: // Found unexpected character '"' while looking for character ',' string json3 = @"{ ""x"": { ""y"": { ""z"": ""{"" } } }"; bool success3 = VRCJson.TryDeserializeFromJson(json3, out DataToken result3); Debug.Log(success3); Debug.Log(result3.ToString()); // Expected: true // Actual: false // // UnableToParse: Unable to Deserialize from Json: // Found end of string before finishing object // Control case: this valid JSON deserializes successfully. string control = @"{ ""x"": { ""y"": { ""z"": ""}"" } } }"; bool controlSuccess = VRCJson.TryDeserializeFromJson(control, out DataToken controlResult); Debug.Log(controlSuccess); Debug.Log(controlResult.ToString()); // Expected: true // Actual: true This may be related to the previously reported issue: "VRCJson.TryDeserializeFromJson may still incorrectly parse arrays when strings contain brackets" ( https://feedback.vrchat.com/udon/p/vrcjsontrydeserializefromjson-may-still-incorrectly-parse-arrays-when-strings-co ) That report is marked complete, but similar parsing failures remain reproducible with braces inside string values in nested JSON objects in client build 1896.
0
·
Bug Reports
"System.ArgumentException: Type provided must be an Enum" when using user-defined enum as a default parameter value in UdonSharp
Defining a method parameter of a user-defined enum type with a default value causes the UdonSharp compiler to throw during binding. The same method compiles successfully when the default value is removed. This issue does not reproduce with Unity/SDK-defined enums (e.g., UnityEngine.HumanBodyBones , VRC_Pickup.PickupHand). Reproduction using UdonSharp; public class EnumTest : UdonSharpBehaviour { // Compile error public void TestMethod(TestEnum testEnum = TestEnum.ValueB) { } } public enum TestEnum { ValueA, ValueB, ValueC } Actual Behavior Compile fails with Assets/Main/Misc/Enum/EnumTest.cs(6,0): System.ArgumentException: Type provided must be an Enum. Parameter name: enumType at System.Enum.ToObject (System.Type enumType, System.Int32 value) at System.Enum.ToObject (System.Type enumType, System.Object value) at UdonSharp.Compiler.Symbols.ParameterSymbol..ctor (...) at UdonSharp.Compiler.Symbols.UdonSharpBehaviourTypeSymbol.CreateSymbol (...) ... (Full message attached below) The exception is thrown inside ParameterSymbol when UdonSharp tries to evaluate a parameter’s default value using Enum.ToObject(enumType, value) during compilation. For user-defined enums, this call receives an argument that is not recognized as a valid enum type for some reason, which causes System.ArgumentException: Type provided must be an Enum . Workarounds Avoid using default parameter values for enums and provide an overload as a pseudo-default instead public void TestMethod(TestEnum testEnum) { } public void TestMethod() => TestMethod(TestEnum.ValueA);
1
·
Bug Reports
·
tracked
Load More