fix: skip unsafe Fusion serialization types#1127
Conversation
📝 WalkthroughWalkthroughThis PR adds a safety mechanism to ChangesUnsafe Type Detection and Filtering
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi, can you merge it with the latest beta branch so I could run CI test. Thanks! |
…ype-serialization
|
Merged the latest |
|
Hi, sorry for the wait. Just checked the PR and its legit. I did not have time to reproduce it, but the code looks great. Just let me know if you can update the crashingTypeNames if you find any future errors. Thanks for the work!! |
|
Also one more thing, the crash means editor crash, and disconnect means MCP server disconnect? How are these different scenarios triggered? |
Description
Fixes component serialization crashes/disconnects caused by Photon Fusion IL-weaved unsafe types being accessed through reflection.
Type of Change
Save your change type
Changes Made
Type.IsByRefLikedetection so older supported Unity runtimes can still compile.Testing/Screenshots/Recordings
git diff --checkFusionUnsafeTypeSerializationTests.GetComponentData_SkipsFusionUnsafeTypesInsideContainerspassed (total=1 passed=1 failed=0)FusionUnsafeTypeSerializationTests.GetComponentData_SkipsFusionUnsafeTypesInsideContainerspassed (total=1 passed=1 failed=0)NetworkBall/NetworkRig_SharedModesuccessfully.NetworkBall.prefabandNetworkRig_SharedMode.prefabsuccessfully.Fusion.NetworkObject,Fusion.NetworkTransform,Fusion.Addons.Physics.NetworkRigidbody3D,Fusion.XR.Host.Rig.NetworkRig, and Gorimon customNetworkBehaviourcomponents without Editor crash.Documentation Updates
tools/UPDATE_DOCS_PROMPT.md(recommended)tools/UPDATE_DOCS.mdRelated Issues
Fixes #1128
Additional Notes
The project declares Unity 2021.3 support, but Unity 2021.3.45f2 is not installed on this machine. I avoided a direct dependency on
Type.IsByRefLikeby using reflection and validated on the installed 2022.3.62f1 and 6000.0.41f1 editors.Summary by CodeRabbit
Bug Fixes
Tests