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

Critical compatibility issue in Kotlin implementation due to MIME type serialization mismatch #260

Closed
akowal opened this issue Apr 26, 2024 · 0 comments

Comments

@akowal
Copy link
Contributor

akowal commented Apr 26, 2024

The current serialization of custom MIME types in Kotlin's RSocket implementation is not compatible with other implementations. The issue lies in the handling of the MIME type name's size during serialization and deserialization. Specifically, the Kotlin implementation directly writes the length of the MIME type name as it is:

writeByte(typeBytes.size.toByte()) //write length

Contrarily, other RSocket implementations such as Go and Java adjust the MIME type name length by decreasing it by one when writing and increasing it by one when reading:

This discrepancy makes Kotlin implementation incompatible with all other implementations.

@akowal akowal changed the title Critical compatibility issue in Kotlin Implementation due to MIME type serialization mismatch Critical compatibility issue in Kotlin implementation due to MIME type serialization mismatch Apr 26, 2024
akowal added a commit to akowal/rsocket-kotlin that referenced this issue Apr 26, 2024
akowal added a commit to akowal/rsocket-kotlin that referenced this issue Apr 26, 2024
akowal added a commit to akowal/rsocket-kotlin that referenced this issue May 13, 2024
akowal added a commit to akowal/rsocket-kotlin that referenced this issue May 13, 2024
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

No branches or pull requests

1 participant