This is one of the common error logs i see in AppCenter for my app:
SIGABRT: A task was canceled.
NativeMessageHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
HttpClient.FinishSendAsyncBuffered (System.Threading.Tasks.Task1[TResult] sendTask, System.Net.Http.HttpRequestMessage request, System.Threading.CancellationTokenSource cts, System.Boolean disposeCts) ApiWrapper
1[T].Get (System.String url, System.Boolean requiresToken)
WorkOrdersApiService.Get (System.Int32 id)
WorkOrderDetailsPageViewModel.ReloadWorkOrder (System.Int32 workOrderId)
WorkOrderDetailsPageViewModel.OnWorkOrderUpdated3 (LiveDispatch.Mobile.ViewModels.CompleteWorkOrderPageViewModel arg1, LiveDispatch.Mobile.DTOs.WorkOrderDTO arg2)
AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state)
NSAsyncSynchronizationContextDispatcher.Apply ()
(wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate)
UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName)
Application.Main (System.String[] args)
I googled it and it looks like it's a connection issue.
Is there something I can do about it in the backend? Or is it really just poor connection and there's nothing I can do?
I use a singleton HttpClient
, in case it's relevant to know, and the backend is a .NET MVC project...
Answers
Can you reproduce this when debugging the project?
I can't spot the issue due to the logs you posted above.
Did your application crash or it can't connect to the appcenter service?
@LandLu it can connect to AppCenter, in fact that is the error I see in AppCenter
I can never reproduce it, I just go to AppCenter and see a bunch of these errors and I am wondering what could cause them.
It happens to some customers but they can't explain, i am also not in direct contact with many of them.
It's better to stably reproduce the issue on your side. And then we could talk about the workaround.
I can't get what caused this issue based on the logs you posted as I said above.
Maybe, you could seek the help of App Center support.
I found a way to simulate slow connection with Xcode additional tools and I was able to get the API calls to fail with the same errors that are logged:
So I guess that's the answer, now it's just up to me to decide what to do to handle those scenarios.
For those interested, I followed these steps:
https://www.natashatherobot.com/simulate-bad-network-ios-simulator/