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

fix: fieldarray deserialization fail #64

Merged
merged 6 commits into from
Mar 20, 2023

Conversation

jdelgadoalfonso
Copy link
Contributor

@jdelgadoalfonso jdelgadoalfonso commented Feb 27, 2023

Fieldarray deserialization fail because of length counts bytes instead of number of elements in the array.

Making an app which consumes from a queue that is bind to the RabbitMQ event exchange plugin, I faced up with a panic deserializing the header.

There is a client_properties field of type FieldArray. RabbitMQ is filling the length with the number of bytes instead of the number of elements of the given array

amqp_serde/src/types.rs Outdated Show resolved Hide resolved
Copy link
Owner

@gftea gftea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much for your PR!

amqp_serde/src/de.rs Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Feb 27, 2023

Codecov Report

Merging #64 (cb14008) into main (cc5dfda) will decrease coverage by 0.21%.
The diff coverage is 76.78%.

@@            Coverage Diff             @@
##             main      #64      +/-   ##
==========================================
- Coverage   85.33%   85.12%   -0.21%     
==========================================
  Files          42       42              
  Lines        5850     5931      +81     
==========================================
+ Hits         4992     5049      +57     
- Misses        858      882      +24     
Impacted Files Coverage Δ
amqp_serde/src/ser.rs 82.26% <35.71%> (-4.29%) ⬇️
amqp_serde/src/types.rs 72.80% <52.77%> (-0.98%) ⬇️
amqp_serde/src/de.rs 92.51% <100.00%> (+0.81%) ⬆️
amqprs/src/api/connection.rs 87.19% <0.00%> (-0.45%) ⬇️
amqprs/src/frame/mod.rs 84.78% <0.00%> (+1.08%) ⬆️
amqprs/src/api/error.rs 44.44% <0.00%> (+11.11%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

amqp_serde/src/types.rs Outdated Show resolved Hide resolved
@jdelgadoalfonso jdelgadoalfonso marked this pull request as draft March 1, 2023 15:30
@jdelgadoalfonso jdelgadoalfonso marked this pull request as ready for review March 3, 2023 07:56
@jdelgadoalfonso jdelgadoalfonso marked this pull request as draft March 3, 2023 07:56
@gftea gftea mentioned this pull request Mar 20, 2023
3 tasks
@gftea gftea marked this pull request as ready for review March 20, 2023 23:13
@gftea gftea merged commit c9c628c into gftea:main Mar 20, 2023
@jdelgadoalfonso jdelgadoalfonso deleted the fix_fieldarray_de branch March 26, 2023 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants