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

[IMPROVED] MQTT: do not JSON-encode retained message bodies (restore #4825) #5050

Merged
merged 11 commits into from
Feb 13, 2024

Conversation

levb
Copy link
Contributor

@levb levb commented Feb 9, 2024

This change is for 2.11 only. As noted in the original PR, downgrading to 2.10 and below would result in data loss for MQTT retained messages (and potential error handling issues).

#4825 was reverted from main, adding it back now, with some changes. Specifically, no longer use JSON for the header value; instead use 4 separate headers.

The revert was messy, not sure I can reproduce the issue seen in the original PR.

server/mqtt.go Outdated Show resolved Hide resolved
@levb levb marked this pull request as ready for review February 11, 2024 14:28
@levb levb requested a review from a team as a code owner February 11, 2024 14:28
@levb levb requested a review from kozlovic February 11, 2024 16:10
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM - a small nit. Will let @kozlovic take a proper look.

server/mqtt.go Outdated Show resolved Hide resolved
server/mqtt.go Outdated Show resolved Hide resolved
@levb levb changed the title WIP: [IMPROVED] MQTT: do not JSON-encode retained message bodies (restore #4825) [IMPROVED] MQTT: do not JSON-encode retained message bodies (restore #4825) Feb 12, 2024
Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

Little changes needed in the test code only.

server/mqtt_test.go Show resolved Hide resolved
server/mqtt_test.go Show resolved Hide resolved
server/mqtt_test.go Show resolved Hide resolved
server/mqtt_test.go Show resolved Hide resolved
server/mqtt_test.go Show resolved Hide resolved
server/mqtt_test.go Show resolved Hide resolved
server/mqtt_test.go Outdated Show resolved Hide resolved
@levb levb requested a review from kozlovic February 13, 2024 16:47
Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

LGTM

@derekcollison derekcollison merged commit 19cba6f into main Feb 13, 2024
4 checks passed
@derekcollison derekcollison deleted the lev-mqtt-recover-unjson branch February 13, 2024 17:49
@bruth bruth added this to the 2.11.0 milestone Feb 27, 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

Successfully merging this pull request may close these issues.

4 participants