Tyrrrz / LightBulb

Reduces eye strain by adjusting screen gamma based on the current time
MIT License
2.23k stars 141 forks source link

Crashes when GitHub is unreachable #315

Closed TearOfTheStar closed 3 months ago

TearOfTheStar commented 3 months ago

Version

v2.5.2

Platform

Windows 10 22H2 (19045.4412) x64

Steps to reproduce

  1. Internet is off (no connection to ISP thru router).
  2. Restart system.
  3. Start Lightbulb.

Details

Hello,

After my ISP connection died, lightbulb started crashing 5-10 seconds after launching (after system restart). After internet came back, it works no problem.

Here's the log from windows' Event Viewer:

Application: LightBulb.exe
CoreCLR Version: 8.0.624.26715
.NET Version: 8.0.6
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Net.Http.HttpRequestException: No such host is known. (api.github.com:443)
 ---> System.Net.Sockets.SocketException (11001): No such host is known.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError, CancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs, ValueTask, CancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String, Int32, HttpRequestMessage, Boolean, CancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String, Int32, HttpRequestMessage, Boolean, CancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage, Boolean, CancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage, Boolean, CancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(QueueItem)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage, Boolean, Boolean, CancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage, Boolean, CancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage, Boolean, CancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken)
   at Onova.Services.GithubPackageResolver.GetPackageVersionUrlMapAsync(CancellationToken) in /_/Onova/Services/GithubPackageResolver.cs:line 130
   at Onova.Services.GithubPackageResolver.GetPackageVersionsAsync(CancellationToken ) in /_/Onova/Services/GithubPackageResolver.cs:line 160
   at Onova.UpdateManager.CheckForUpdatesAsync(CancellationToken ) in /_/Onova/UpdateManager.cs:line 121
   at LightBulb.Services.UpdateService.CheckForUpdatesAsync()
   at LightBulb.ViewModels.MainViewModel.<.ctor>b__0_0()
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()

Checklist