rollbar / Rollbar.NET

Rollbar for .NET
https://docs.rollbar.com/docs/dotnet
MIT License
65 stars 44 forks source link

ConnectivityMonitor tests wrong thing #615

Closed pbiggar closed 2 years ago

pbiggar commented 2 years ago

The ConnectivityMonitor is required for queued events to be sent to the API. Before an event is sent, the ConnectivityMonitor checks if the internet is available.

However, it checks www.rollbar.com on port 80, not api.rollbar.com on port 443, which is what's required to send to the API.

For servers on which port 80 is blocked, the ConnectivityMonitor reports that the server is offline. However, in my case, the server is perfectly capable of reaching https://api.rollbar.com.

As further issues, the ConnectivityMonitor is not covered in the documentation - I had to search the codebase for the error I was experiencing and read the code to discover the issue.

Finally, it seems that while I can reach the ConnectivityMonitor via Rollbar.RollbarInfrastructure.Instance.ConnectivityMonitor, I don't seem to be able to call the Disable method on it, as that returns an IConnectivityMonitor.

akornich commented 2 years ago

@pbiggar , thanks for catching it. I'll be fixing it shortly. I'll also add public access to Rollbar.RollbarInfrastructure.Instance.ConnectivityMonitor?.Disable()