Skip to content

[BUG] Have issue with Unity stripping away data from classes (ex. Dissonity.Models.Interop.InteropMessage #52

@ETdoFresh

Description

@ETdoFresh

Describe the bug
When in WebGL build in Discord, I have an issue where the hiRPC is not working.

Reproduction
I cannot show exactly the code that I'm using, but it's not very complex, and it really just gets stuck at
await Dissonity.Api.Initialize()

Expected behavior
It should not get stuck. But, I found the reason as shown in the screenshot.

Screenshots

Image

Logged from DissonityBridge.cs#L260-L261
[It early returns because hiRPC message is null... maybe instead of early return, it should be an exception?]

Platform
WebGL

Additional context
Here are two workarounds/fix. I can put a workaround as a PR if desired. Just let me know which one.

Workaround/Fix 1
Add link.xml to your Assets folder

<linker>
    <assembly fullname="Furnyr.Dissonity" preserve="all"/>
</linker>

Workaround/Fix 2
Add [UnityEngine.Scripting.Preserve] on stripped classes or properties.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingv2Related to Dissonity v2

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions