commercetools / commercetools-sdk-java-v2

The e-commerce SDK from commercetools for Java.
https://commercetools.github.io/commercetools-sdk-java-v2/javadoc/index.html
Apache License 2.0
35 stars 16 forks source link

CompatSphereClient clientConfig.getCorrelationIdGenerator() not public/accessible with SDKV1 < 2.** #227

Closed pintomau closed 2 years ago

pintomau commented 2 years ago

Describe the bug SphereClientConfig#getCorrelationIdGenerator is package-private in SDKV1 <2, and public in SDKV1 >=2. CompatSphereClient breaks for versions lower than 2 due to calling the above method when using SDKV1 <2.

To Reproduce Create a CompatSphereClient while depending on SDK V1 lower than 2 and trigger a request.

Observe the error:

CompatSphereClient tried to access method 'io.sphere.sdk.client.CorrelationIdGenerator io.sphere.sdk.client.SphereClientConfig.getCorrelationIdGenerator()'

Expected behavior An alternative path for SDKV1 lower than V2.

Screenshots/Code snippet If applicable, add screenshots or code samples to help explain your problem.

Stack information (please complete the following information):

Additional context

Possible mitigation: the class is simple enough that just copying and removing the line should be enough. We decorate the client to produce the correlation id, so we expect no impact by doing so.

jenschude commented 2 years ago

Just released a 1.64.2 which makes the CorrelationIdGenerator interface public

Edit: directly saw my mistake 🤦‍♂️ The config method will also be opened

jenschude commented 2 years ago

And 1.64.3 released which backports the changes from the 2.0 release

pintomau commented 2 years ago

Hey @jenschude , thanks a lot for the changes!

Can we expect a minor on the Sync to bump these versions as well or would we need to override them for now?

jenschude commented 2 years ago

I'm not involved in the sync library. So you have to ask there or just override it