CollapseLauncher / Collapse

An Advanced Launcher for miHoYo/HoYoverse Games
MIT License
1.41k stars 65 forks source link

[Bug]: Internet connection drops out/times out and download stops with an Unhandled Error popup #519

Closed Moravuscz closed 4 months ago

Moravuscz commented 4 months ago

Affected Version

1.80.14-PRE

Bug Behavior

I have slow and unreliable internet connection - when the connection drops out the download stops and an Unhandled Error popup appears with the stack trace.

Expected Behavior

Keep retrying every few seconds and continue download.

Steps to reproduce

  1. Start downloading the game
  2. Have your connection drop out (without disconnecting Wi-Fi or Ethernet cable)
  3. Connection times out and produces unhandled error

Related Issues

No response

Screenshot(s)

image

Additional Information

System.TimeoutException: Request for session ID: 16258 has timed out!
 ---> System.Threading.Tasks.TaskCanceledException: OperationCanceled
 ---> System.IO.IOException: net_io_readfailure, The I/O operation has been aborted because of either a thread exit or an application request.
 ---> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request.
   Exception_EndOfInnerExceptionStack
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError, CancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16)
   at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken, Int32)
   at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16)
   at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory`1, CancellationToken)
   at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16)
   at System.Net.Http.HttpConnection.ReadAsync(Memory`1)
   at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Memory`1, CancellationToken)
   Exception_EndOfInnerExceptionStack
   at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Memory`1, CancellationToken)
   at Hi3Helper.Http.HttpResponseInputStream.ReadAsync(Byte[], Int32, Int32, CancellationToken )
   at Hi3Helper.Http.Http.SessionTaskRunnerContainer(Session, CancellationToken)
   Exception_EndOfInnerExceptionStack
   at Hi3Helper.Http.Http.SessionTaskRunnerContainer(Session, CancellationToken)
   at Hi3Helper.Http.Http.SessionTaskRunnerContainer(Session, CancellationToken)
   at Hi3Helper.Http.Http.<TaskWhenAllSession>b__41_0(Session session, CancellationToken innerToken)
   at System.Threading.Tasks.Parallel.<>c__57`1.<<ForEachAsync>b__57_0>d.MoveNext()
--- End of stack trace from previous location ---
   at Hi3Helper.Http.Http.TaskWhenAllSession(IAsyncEnumerable`1, CancellationToken, Int32)
   at Hi3Helper.Http.Http.Download(String, String, Byte , Boolean , CancellationToken )
   at CollapseLauncher.InstallManager.Base.InstallManagerBase`1.RunPackageDownloadRoutine(GameInstallPackage package, CancellationToken token, Int32 packageCount)
   at CollapseLauncher.InstallManager.Base.InstallManagerBase`1.InvokePackageDownloadRoutine(List`1 packageList, CancellationToken token)
   at CollapseLauncher.InstallManager.Base.InstallManagerBase`1.StartPackageDownload(Boolean skipDialog)
   at CollapseLauncher.Pages.HomePage.InstallGameDialog(Object sender, RoutedEventArgs e)
Cryotechnic commented 4 months ago

Heyo, this is intended behavior as Collapse attempts to restore the connection a couple of times before giving up. This is not a bug and is behaving as expected. That being said, I believe the confusion is that this is an error that does not provide enough context for the user. Thus, maybe adding a message to the user may help, though it remains up for deliberation @bagusnl