realm-dotnet
realm-dotnet copied to clipboard
Investigate Unity initialization when domain reloading is turned off
A user reported that when they turn off domain reloading in Project Settings->Editor->Enter Play Mode Settings
, the second time they enter play mode, the SDK will hang when attempting to login a user. We should figure out what's causing this and guard against it. See this forum post for more details.
Any updates or findings related to this yet? :) Our project is growing fast and domain reload times are already taxing our iteration speed. We'd love to turn them off.
I'm sorry - we haven't had time to look at it yet. We've had to reshuffle some resources and a significant portion of the .NET team is helping other teams currently. This ticket is top of our backlog though, so as soon as we're done with time-sensitive feature work, we'll look at it.
Happy New Year ;-)
This issue still hasn't been resolved and it really does make a huge difference when working on a Unity project (iteration speed).
It would be very much appreciated if you could provide an update on when/if this can be prioritised, thanks!
I believe I have a fix for this - it appears the issue was that on domain unload/application exit, we detach the hooks into native to allow Unity to exit cleanly (otherwise native async operations may hang up the editor/game on exit). But because we were only attaching these hooks in static constructors, those weren't getting called when the app is restarted without a domain reload. I've followed the Unity docs on how to handle that case and it seems to be working correctly in the repro I cooked up. Once the CI build completes, I can try and give you the compiled package to test on your project.
Here's a link for the updated package: https://drive.google.com/file/d/1D0tOOjVQ8xmNDTl5FjnGxgXzjB53Krne/view?usp=share_link. If you get a chance to test it out and confirm it resolves the issue, that would be amazing.
@nirinchev that sounds great! Thank you!
I will be happy to test the updated package later today. I’ll reply again once I’ve been able to test.
I've just installed the pre-release build and disabled domain reloading in my Unity project - and everything is good! It makes such a huge difference in the turn around time while developing. Thanks again @nirinchev!