-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected Exception #2400
Comments
Hi @ivanrlg. Does this kind of exception happen only on UWP or also on iOS/Android? |
Can you try removing the |
Hi @papafe, this happens in UWP, in Android I think the same although it happens slightly differently. I haven't tried that version, I will and let you know. |
Hi @nirinchev, ok I'm going to try as you tell me, I'm curious that it only happens after the first synchronization (when the installation is new) then it doesn't happen. |
Hi @papafe / @nirinchev probe with version 10.2.0-beta.2 and it keeps giving the same error. But, I think I figured it out, all this started to know the initial download in the first sync, so comment this code:
and vualá, the exception no longer happened. Again curious that it only happens the first time. If you wish, you can close the case. In the same way, I will leave the last message obtained here if I did not comment on the above.
|
Are you by any chance modifying the this.syncConfig = new SyncConfiguration(...);
public async Task<Realm> GetInstanceAsync()
{
this.syncConfig.OnProgress = (...);
return Realm.GetInstanceAsync(this.syncConfig);
};
public Realm GetInstance()
{
this.syncConfig.OnProgress = null;
return Realm.GetInstance(this.syncConfig);
} Asking because I noticed a potential bug where we're not capturing the OnProgress property when GetInstanceAsync is called, which means that modifying it while the Realm is being downloaded might result in unpredictable behavior. |
Hi @nirinchev , I tried to fix it as you told me but I couldn't do it exactly the same because I don't use GetInstance but it is with "Async". Perhaps I am committing a bad practice of using your library, but this way I did not get more errors from incorrect threads and the like. I would still like to learn to do it in the best way. I was able to modify the GetInstanceAsync and it looks like this:
But sadly I got the exception again. The thread 0x15d94 has exited with code 0 (0x0). |
Hey @ivanrlg, I'm sorry if I wasn't clear - I wasn't suggesting that this approach would fix things for you, I was just wondering if a pattern like the outlined one is something that may be used in your app. Essentially, I wanted to know if you create a new sync config every time you call |
Hey @nirinchev , I have a LoginRealm method that I only call when the application is started at that moment there I have the new SyncConfig only that time it is executed, then in the |
Goals
Discover the cause of the exception
Expected Results
Not have the unexpected exception
Actual Results
Steps to Reproduce
When installing on a new device after syncing the first time, the exception occurs when I try to search for a record.
I have tried to catch him with a try but it is not possible.
It is important to note that after the exception occurs, the second time I try to enter the app it no longer happens.
Code Sample
Image Exception:
https://ibb.co/fX0q8Hn
Version of Realm and Tooling
Xamarin
Android & UWP.
Client SDK Version: Realm 10.1.4.
Client OS & Version: Android 9/10. / Windows 10.
Microsoft Visual Studio Community 2019
Version 16.9.6
The text was updated successfully, but these errors were encountered: