Fix EnvelopeMapper swapped filter predicates breaking single-direction property overrides (#2551)#2573
Merged
jeremydmiller merged 1 commit intomainfrom Apr 23, 2026
Conversation
…leOutgoing (GH-2551) The default header read/write loops in EnvelopeMapper had their filter predicates pointing at the wrong dictionary: - compileIncoming was skipping the default header read whenever a custom *outgoing* mapping existed, so MapOutgoingProperty(x => x.Foo, ...) silently deleted the incoming "foo" header read. - compileOutgoing did the symmetric wrong thing — MapIncomingProperty silently deleted the outgoing header write. Each loop now skips the default only when its own direction has been customized, so MapIncomingProperty / MapOutgoingProperty truly affect only the direction their name implies. Adds four regression tests in MapIncomingPropertyTests covering both directions plus sanity checks that the customization itself still wins on the direction it targets. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 23, 2026
Closed
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.
Fixes #2551.
The bug
EnvelopeMapper<TIncoming, TOutgoing>had its compile-time filter predicates swapped:compileIncomingskipped the default header read whenever a custom outgoing mapping existed, soMapOutgoingProperty(x => x.Foo, ...)silently deleted the incoming"foo"header read.compileOutgoingdid the symmetric wrong thing —MapIncomingProperty(x => x.Foo, ...)silently deleted the outgoing"foo"header write.The reporter observed it on Kafka:
Each filter now correctly checks its own direction's dictionary, so
MapIncomingProperty/MapOutgoingPropertytruly affect only the direction their name implies.Verification
MapIncomingPropertyTestscover both directions + sanity checks that the customization itself still wins on the direction it targets. They fail onmainand pass with this change.CoreTestsnet9.0 run: 1350/1350 pass.Wolverine.Kafka.Testsnet9.0 run: 142/142 pass (2 pre-existing flaky skips). Kafka exercises this codegen end-to-end on a live broker.Test plan
🤖 Generated with Claude Code