Skip to content

impl: relax json syntax rules for deserialization #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fioan89
Copy link
Collaborator

@fioan89 fioan89 commented Jul 28, 2025

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.

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.
Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Does being lineant here increase the bug risk?

@fioan89
Copy link
Collaborator Author

fioan89 commented Jul 29, 2025

In theory it should decrease the risk but I can provide any guarantee until I am able to fully understand why the response is malformed/different.

@code-asher
Copy link
Member

My initial impression is that this would only hide some other bug. Maybe a good first step would be to see if we can improve the error message? Like if we could log the request path and response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy