influxdb-client-csharp icon indicating copy to clipboard operation
influxdb-client-csharp copied to clipboard

Breaking change in 4.12.0 due to RestSharp update to 109+

Open shuebner opened this issue 1 year ago • 2 comments

Steps to reproduce:

Use version 4.11.0 and set a BaseUrl:

ApiClient.RestClient.BaseUrl = new Uri("http://some.url")

Upgrade to 4.12.0.

The code no longer builds even though the version upgrade was minor.

Expected behavior:

Either hide your third-party implementation details behind an interface. Or be aware of breaking changes in your own API via third-party library changes and increase your major version accordingly.

Actual behavior:

RestSharp made a breaking change to RestClient in SHA1:507ed8 and increased heir major version to 109 accordingly. RestSharp as part of the influx client API was updated from 108.0.1 to 110.1.0 (i. e. >=109) between influx client 4.11.0 and 4.12.0. Even though this is a breaking API change for influx client as well, there was no major version increase.

Specifications:

  • Client Version: 4.12.0
  • InfluxDB Version: irrelevant
  • Platform: irrelevant

shuebner avatar May 04 '23 03:05 shuebner

Hi @shuebner,

thanks for using our client,

How do you access to the ApiClient? The ApiClient is internal property of the InfluxDBClient: https://github.com/influxdata/influxdb-client-csharp/blob/9006c29ef6fab8bb0236462168e1b0695957e8f6/Client/InfluxDBClient.cs#L223.

You should set url via constructor:

const string url = "http://localhost:8086";
const string token = "my-token";

using var client = new InfluxDBClient(url, token)

Regards

bednar avatar May 04 '23 04:05 bednar

This has nothing to do with either InfluxDBClient or the URL, but only ApiClient. The class ApiClient is public as is the RestClient property. This makes it part of the public API of the influx client library. Influx published a breaking change in its API under a minor version increment. That is unexpected and -- when following semver rules -- wrong.

shuebner avatar May 04 '23 11:05 shuebner