Repository navigation
fix: align dedup example with upstream end-of-stream semantics - #22
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to the example-alignment review: resolves the remaining drift for the
dedupexample processor (Milestone 4 tail), while leaving theecho/digestdifferences noted during the review alone.
Drift found & fixed in
DedupRequestProcessorComparing the Java example against the Go SDK's
examples/dedup.gorevealed two drifts:PUT,POST, andPATCHrequests (dedupable). The Java version deduped regardless of method(as long as a digest header was present).
check/add during the request-headers phase, but the digest is only attached
at end-of-stream phases (request body phase for requests with bodies — the
primary dedup use case, i.e. PUT/POST/PATCH). The Go version decides at the
end-of-stream phases. As a result, for bodied requests the in-flight cache
could never be populated, and the 409 duplicate path could not fire.
Fix
Rewrote
DedupRequestProcessorto mirror the upstream Go semantics:PUT,POST,PATCH).(cache / cancel-with-409) there.
x-extproc-request-digestheader at end-of-stream.Verification
./gradlew clean build— BUILD SUCCESSFUL (spotless + tests).(exchanges completed without errors).
Out of scope (left as-is per your direction)
echoexample: minor path-matching (startsWith("/echo")vs regex/echo/.*) and response-shape differences.digestexample: extrax-extproc-response-digestheader added in Java thatthe Go example does not add.
Closes the remaining Milestone 4 example-alignment item for
dedup.