Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.397.1"
".": "0.397.2"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.397.2 (2026-01-16)

Full Changelog: [v0.397.1...v0.397.2](https://github.com/Increase/increase-java/compare/v0.397.1...v0.397.2)

### Bug Fixes

* **client:** fully respect max retries ([9bfdc06](https://github.com/Increase/increase-java/commit/9bfdc0664a531b57b07a47aaa03a3dbc573b9e9d))
* **client:** send retry count header for max retries 0 ([9bfdc06](https://github.com/Increase/increase-java/commit/9bfdc0664a531b57b07a47aaa03a3dbc573b9e9d))


### Chores

* **internal:** depend on packages directly in example ([9bfdc06](https://github.com/Increase/increase-java/commit/9bfdc0664a531b57b07a47aaa03a3dbc573b9e9d))

## 0.397.1 (2026-01-16)

Full Changelog: [v0.397.0...v0.397.1](https://github.com/Increase/increase-java/compare/v0.397.0...v0.397.1)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.397.1)
[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.397.1/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.397.1)
[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.397.2)
[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.397.2/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.397.2)

<!-- x-release-please-end -->

Expand All @@ -13,7 +13,7 @@ The Increase Java SDK is similar to the Increase Kotlin SDK but with minor diffe

<!-- x-release-please-start-version -->

The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.397.1).
The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.397.2).

<!-- x-release-please-end -->

Expand All @@ -24,7 +24,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d
### Gradle

```kotlin
implementation("com.increase.api:increase-java:0.397.1")
implementation("com.increase.api:increase-java:0.397.2")
```

### Maven
Expand All @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.397.1")
<dependency>
<groupId>com.increase.api</groupId>
<artifactId>increase-java</artifactId>
<version>0.397.1</version>
<version>0.397.2</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {

allprojects {
group = "com.increase.api"
version = "0.397.1" // x-release-please-version
version = "0.397.2" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
fun build(): OkHttpClient =
OkHttpClient(
okhttp3.OkHttpClient.Builder()
// `RetryingHttpClient` handles retries if the user enabled them.
.retryOnConnectionFailure(false)
.connectTimeout(timeout.connect())
.readTimeout(timeout.read())
.writeTimeout(timeout.write())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ private constructor(
) : HttpClient {

override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse {
if (!isRetryable(request) || maxRetries <= 0) {
return httpClient.execute(request, requestOptions)
}

var modifiedRequest = maybeAddIdempotencyHeader(request)

// Don't send the current retry count in the headers if the caller set their own value.
Expand All @@ -48,6 +44,10 @@ private constructor(
modifiedRequest = setRetryCountHeader(modifiedRequest, retries)
}

if (!isRetryable(modifiedRequest)) {
return httpClient.execute(modifiedRequest, requestOptions)
}

val response =
try {
val response = httpClient.execute(modifiedRequest, requestOptions)
Expand Down Expand Up @@ -75,10 +75,6 @@ private constructor(
request: HttpRequest,
requestOptions: RequestOptions,
): CompletableFuture<HttpResponse> {
if (!isRetryable(request) || maxRetries <= 0) {
return httpClient.executeAsync(request, requestOptions)
}

val modifiedRequest = maybeAddIdempotencyHeader(request)

// Don't send the current retry count in the headers if the caller set their own value.
Expand All @@ -94,8 +90,12 @@ private constructor(
val requestWithRetryCount =
if (shouldSendRetryCount) setRetryCountHeader(request, retries) else request

return httpClient
.executeAsync(requestWithRetryCount, requestOptions)
val responseFuture = httpClient.executeAsync(requestWithRetryCount, requestOptions)
if (!isRetryable(requestWithRetryCount)) {
return responseFuture
}

return responseFuture
.handleAsync(
fun(
response: HttpResponse?,
Expand Down
Loading