Skip to content
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

REST client - Response.getWarnings() does not decode escaped quotes #38189

Closed
markharwood opened this issue Feb 1, 2019 · 4 comments
Closed
Labels
>bug :Clients/Java Low Level REST Client Minimal dependencies Java Client for Elasticsearch Team:Data Management Meta label for data/management team

Comments

@markharwood
Copy link
Contributor

I ran into a failing test scenario where the Java string logged server-side with the DeprecationLogger.deprecatedAndMaybeLog failed to match the same string when materialized client-side using Response. getWarnings().
The string in question had quotes eg:

public static final String DEPRECATION_MESSAGE = "Don't use \"type\" please";

which is encoded to HTTP headers by the logging framework with slashes around the quotes eg Don't use \"type\" please
When deserialized on the client the slashes are not decoded meaning our test fails because Don't use \"type\" please != Don't use "type" please

@markharwood markharwood added >bug :Clients/Java Low Level REST Client Minimal dependencies Java Client for Elasticsearch labels Feb 1, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

@markharwood
Copy link
Contributor Author

markharwood commented Feb 1, 2019

I made a start on the required decoder function but have yet to figure out where to put it. DeprecationLogger felt the most natural place alongside its escapeBackslashesAndQuotes function but the HLRC build has checks to reject classes that refer to this server-side class. Makes it hard for the client-side Response object to invoke.

Either way a gist with the necessary function and test code is here: https://gist.github.com/markharwood/aa5215d0b7128c23d93904774a51e937

markharwood added a commit to markharwood/elasticsearch that referenced this issue Feb 4, 2019
Updated 6.x test expectations
markharwood added a commit to markharwood/elasticsearch that referenced this issue Feb 5, 2019
Updated 6.x test expectations
@jasontedor jasontedor added v8.0.0 and removed v7.0.0 labels Feb 6, 2019
@jakelandis
Copy link
Contributor

We discussed this briefly today in our team sync, and believe that best path forward here is to simply ensure we don't quotes inside quotes. Ideally use [] where applicable. Leaving this issue open until we are

  • Confident that we got them all
  • Have an assertion in DeprecationLogger.deprecatedAndMaybeLog to fail if we encounter escaped quotes

@jakelandis jakelandis added v7.3.0 and removed v7.2.0 labels Jun 17, 2019
@rjernst rjernst added the Team:Data Management Meta label for data/management team label May 4, 2020
@dakrone
Copy link
Member

dakrone commented May 17, 2024

This has been open for quite a while, and we haven't made much progress on this due to focus in other areas. For now I'm going to close this as something we aren't planning on implementing. We can re-open it later if needed.

@dakrone dakrone closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Clients/Java Low Level REST Client Minimal dependencies Java Client for Elasticsearch Team:Data Management Meta label for data/management team
Projects
None yet
Development

No branches or pull requests

8 participants