You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on an SDK for our backend services, which is a .NET Standard 2.1 NuGet package but is used in Unity (via UnityNuGet). In the Unity Editor, I occasionally encounter an InvalidCastException when trying to open a Realm.
So I use a version from NuGet in Unity. I can't use Unity version directly, because my SDK targets .NET Standard, not Unity.
Repro steps
It usually occurs when you unload a game while it is opening a Realm.
at Realms.SynchronizationContextScheduler.IsOnSynchronizationContext (System.IntPtr context, System.IntPtr targetContext) [0x0001b] in<88190757fccb474da2767b2f4a5c18b3>:0
at (wrapper native-to-managed).(wrapper native-to-managed) Realms.SynchronizationContextScheduler.IsOnSynchronizationContext(intptr,intptr)
at (wrapper managed-to-native).(wrapper managed-to-native) Realms.SharedRealmHandle+NativeMethods.open(Realms.Native.Configuration,Realms.NativeException&)
at Realms.SharedRealmHandle.Open (Realms.Native.Configuration configuration) [0x00000] in<88190757fccb474da2767b2f4a5c18b3>:0
at Realms.RealmConfiguration.CreateHandle (Realms.Native.Configuration& configuration) [0x00000] in<88190757fccb474da2767b2f4a5c18b3>:0
at Realms.RealmConfiguration+<>c__DisplayClass24_0.<CreateHandleAsync>b__1 (System.Threading.Tasks.Task _) [0x00000] in<88190757fccb474da2767b2f4a5c18b3>:0
at System.Threading.Tasks.ContinuationResultTaskFromTask`1[TResult].InnerInvoke () [0x00024] in<10d2623021134ffe9e1b5223c5ae4e48>:0
at System.Threading.Tasks.Task.Execute () [0x00000] in<10d2623021134ffe9e1b5223c5ae4e48>:0
--- End of stack trace from previous location where exception was thrown ---
at Realms.RealmConfigurationBase.CreateRealmAsync (System.Threading.CancellationToken cancellationToken) [0x00098] in<88190757fccb474da2767b2f4a5c18b3>:0
Relevant log output
No response
The text was updated successfully, but these errors were encountered:
We're moving away from duplicating github issues in Jira, which is why the Jira ticket was closed. There's no obvious workaround other than not using the asynchronous API here. It was primarily useful for synchronized Realms where you wanted to wait for the download to complete before you display the data, but for local use cases, there's no particular benefit. If you do want to keep it for the sake of executing migrations on a background thread, you could make it conditional, where it uses the async API in release builds, but the sync one in debug builds.
What happened?
I am working on an SDK for our backend services, which is a .NET Standard 2.1 NuGet package but is used in Unity (via UnityNuGet). In the Unity Editor, I occasionally encounter an InvalidCastException when trying to open a Realm.
So I use a version from NuGet in Unity. I can't use Unity version directly, because my SDK targets .NET Standard, not Unity.
Repro steps
It usually occurs when you unload a game while it is opening a Realm.
Version
20.0.0
What Atlas Services are you using?
Local Database only
What type of application is this?
Unity
Client OS and version
Unity Editor (2022.3.51а1) on MacBook
Code snippets
Stacktrace of the exception/crash you're getting
Relevant log output
No response
The text was updated successfully, but these errors were encountered: