Content-Length: 310660 | pFad | http://github.com/coder/coder-jetbrains-toolbox/commit/4f1c279154ef6929a36107f0dc3375df0eac34f1

F8 impl: relax json syntax rules for deserialization · coder/coder-jetbrains-toolbox@4f1c279 · GitHub
Skip to content

Commit 4f1c279

Browse files
committed
impl: relax json syntax rules for deserialization
For some clients, workspace polling fails due to the following error: ``` com.squareup.moshi.JsonEncodingException: Use JsonReader.setLenient(true) to accept malformed JSON at path $ ``` I haven’t been able to reproduce this issue, even using the same version deployed at the client (2.20.2). This change is an attempt to relax the JSON parsing rules by enabling lenient mode, in the hope that it will resolve the issue on the client side.
1 parent c5f8e12 commit 4f1c279

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Changed
6+
7+
- the http client has relaxed syntax rules when deserializing JSON responses
8+
59
## 0.6.0 - 2025-07-25
610

711
### Changed

src/main/kotlin/com/coder/toolbox/sdk/CoderRestClient.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ open class CoderRestClient(
7474
var builder = OkHttpClient.Builder()
7575

7676
if (context.proxySettings.getProxy() != null) {
77-
context.logger.debug("proxy: ${context.proxySettings.getProxy()}")
77+
context.logger.info("proxy: ${context.proxySettings.getProxy()}")
7878
builder.proxy(context.proxySettings.getProxy())
7979
} else if (context.proxySettings.getProxySelector() != null) {
80-
context.logger.debug("proxy selector: ${context.proxySettings.getProxySelector()}")
80+
context.logger.info("proxy selector: ${context.proxySettings.getProxySelector()}")
8181
builder.proxySelector(context.proxySettings.getProxySelector()!!)
8282
}
8383

@@ -133,7 +133,7 @@ open class CoderRestClient(
133133

134134
retroRestClient =
135135
Retrofit.Builder().baseUrl(url.toString()).client(httpClient)
136-
.addConverterFactory(MoshiConverterFactory.create(moshi))
136+
.addConverterFactory(MoshiConverterFactory.create(moshi).asLenient())
137137
.build().create(CoderV2RestFacade::class.java)
138138
}
139139

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/coder/coder-jetbrains-toolbox/commit/4f1c279154ef6929a36107f0dc3375df0eac34f1

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy