Fix field count encoding in DescribedList and add tests for full field count compliance#645
Open
kamil-mrzyglod wants to merge 1 commit into
Open
Conversation
…d count compliance
Member
|
Since this is permitted by AMQP 1.0 spec, should we fix the other clients instead? |
Author
|
@xinchen10 I am not in a position to influence the direction, but IMHO fixing other clients isn't the solution. Yes, AMQP spec allows the existing behaviour but other SDKs fail to comply with AMQPNet for a reason. To me the proposed fix is a much better solution - it fixes the issue centrally, is simple and the change is strictly additive. |
Member
|
Thanks for bringing up the issue. I am reaching out to the SDK owners to get it fixed there. Azure SDKs should be protocol compliant. AMQP is a standard and has more clients than just Azure SDKs. The Apache qpid-proton-j does same compact encoding of composite list types. |
Author
|
Thanks @xinchen10 :) |
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.
DescribedList.EncodeValue() previously stopped encoding at the last non-null field, which is permitted by AMQP 1.0 spec section 1.4 but breaks non-.NET clients (Python _pyamqp, uamqp) that access performative fields by fixed numeric index — causing IndexError when the encoded list is shorter than expected.
This change replaces the last-set-bit calculation with this.fieldCount, so all defined fields are always written (unset ones as null bytes). This matches the behaviour of the real Azure Service Bus / Event Hubs broker.
References: TheCloudTheory/Topaz#210.