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

Broken digest when recording json that includes non-required special characters #6194

Open
scbedd opened this issue May 17, 2023 · 3 comments
Assignees
Labels
Test-Proxy Anything relating to test-proxy requests or issues.

Comments

@scbedd
Copy link
Member

scbedd commented May 17, 2023

The java folks have a super fun situation on their hands. @lmolkova is transitioning the container registry tests to the test proxy.

Sameeksha's original thought is that as part of this test, json is sent to the service with some content that looks something like this:

// headers include a digest:
//  digest: <hash of body + other stuff>
// body is json:
{
    "key": "\/hello"
}

Which, when deserialized, sanitized, and reserialized, has a unnecessary backslash disappear and becomes

{
  "key": "/hello"
}

Such that when we run in playback, the digest now doesn't align. Included in the original context of this issue was a stack overflow that highlights why this may be occurring for this service 👍

We need to come up with a resolution for this situation.

Repro

  1. Check out this branch
  2. mvn install -f .\sdk\containerregistry\azure-containers-containerregistry\pom.xml "-Dcodesnippet.skip" "-Drevapi.skip" "-Dspotbugs.skip" -DskipTests=true "-Djacoco.skip" "-Dmaven.javadoc.skip=true" -DskipTestCompile "-Dcheckstyle.skip=true"
  3. mvn surefire:test -f .\sdk\containerregistry\azure-containers-containerregistry\pom.xml "-Dcodesnippet.skip" "-Drevapi.skip" "-Dspotbugs.skip" "-Djacoco.skip" "-Dmaven.javadoc.skip=true" -DskipTestCompile "-Dcheckstyle.skip=true" "-Dtest=ContainerRegistryContentClientIntegrationTests#getManifestListManifest"

CC @samvaity for FYI

@scbedd scbedd added the Test-Proxy Anything relating to test-proxy requests or issues. label May 17, 2023
@scbedd scbedd self-assigned this May 17, 2023
@scbedd scbedd moved this from 🤔 Triage to 🐝 Dev in Azure SDK EngSys 🤖🧠 May 17, 2023
@scbedd
Copy link
Member Author

scbedd commented May 17, 2023

Dug further into the live vs playback provided by @samvaity

It's not a case of \/ being disappeared, it's \\/. I think we are handling this incorrectly, but I don't know why we haven't seen anything like this in the past.

@scbedd
Copy link
Member Author

scbedd commented May 18, 2023

This is why the double escape is disappearing.

Have some reading to do, as swapping this value to JavaScriptEncoder.Default (which is stricter about what stuff actually gets serialized) isn't a magic bullet.

@scbedd scbedd moved this from 🐝 Dev to 📋 Backlog in Azure SDK EngSys 🤖🧠 Jul 19, 2023
@scbedd
Copy link
Member Author

scbedd commented Jun 27, 2024

I have addressed this in #8430 and #8325 .

It will require a re-record of the tests that have this issue and are currently marked as live only. Executing on that today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test-Proxy Anything relating to test-proxy requests or issues.
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant