-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
The latest version (6.0.20) seems to be partly broken when used in Xamarin.iOS #424
Comments
@raymond-u what turned out to be the issue? |
@PureWeen Sorry I don't know why. 😬 I closed this because I wouldn't be responsible to do any further research on this issue later on 🤭 I turned to use Realm instead, sorry. |
Alright :-) The reason it's locking is because of the Wait. FinishedLaunching is running on the UI Thread so when you call Wait you've now blocked the UI Thread and there are certain initialization that have to happen on the UI Thread but they can't because the UI Thread is blocked with the wait. In general with Reactive/Tasks you never want to call wait. I tested LoadImageUrl code with a subscribe and it worked fine. I also tested it with an async await call async void PerformLoad()
{
var result = await BlobCache.LocalMachine.LoadImageFromUrl(@"https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png");
} And it loaded fine from that as well. |
@PureWeen Hm but in my case since Edit: The error info was 'XPC connection interrupted'. |
Note: for support questions, please ask on StackOverflow: https://stackoverflow.com/questions/tagged/Akavache . This repository's issues are reserved for feature requests and bug reports.
Do you want to request a feature or report a bug?
bug
What is the current behavior?
I was originally trying to fetch and cache an image using
BlobCache.LocalMachine.LoadImageFromUrl(someURL)
, but I found that itjust stopped responding after I called this method. (Yes, I've set
BlobCache.ApplicationName
, I even calledBlobCache.EnsureInitialized()
, and the SQL3 lib wasn't stripped by the linker.) So I did some experiments and tried to find out what was wrong.After several hours of testing I found that only these methods should work in my circumstances:
1.
Also, whenever I use await in my code, it falls to infinite deadlock(?). Say,
var value = await BlobCache.LocalMachine.GetObject<string>(key);
. (Of course I've importedSystem.Reactive.Linq
.) The possible workaround to me is usingwait()
orsubscribe()
.BlobCache.LocalMachine.GetOrFetchObject()
won't work either.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
Try adding these lines of code in a newly created Xamarin.iOS project. Since it's test purpose only so simply add them into AppDelegate.cs file should do.
What is the expected behavior?
It at least shouldn't get stuck.
What is the motivation / use case for changing the behavior?
N/A
Which versions of Akavache, and which platform / OS are affected by this issue? Did this work in previous versions of Akavache? Please also test with the latest stable and snapshot (https://www.myget.org/feed/Akavache/package/nuget/Akavache) versions.
Akavache 6.0.20
I'm testing with the latest Xamain.iOS & mono build on VS Mac.
Other information (e.g. stacktraces, related issues, suggestions how to fix)
P.S: If I've missed anything, please enlighten me 🤭
The text was updated successfully, but these errors were encountered: