Repository navigation
mqtt-hivemq: restore client subscriptions when a handler registers again - #277
Closed
tipatterson-dev wants to merge 3 commits into
Closed
tipatterson-dev wants to merge 3 commits into
tipatterson-dev wants to merge 3 commits into
Conversation
tipatterson-dev
changed the base branch from
bugfix/mqtt-hivemq/257-subscribe-recheck
to
master
November 12, 2026 16:27
Member
Author
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 lost subscriptions in the HiveMQ extension: after a handler module restarted, clients that were already subscribed got no more messages.
Closes #269. Part of #249. Needs #262, which is merged: this branch starts from it. The PR targets
master.Problem
When a module that registers an MQTT handler restarts while the MQTT Server runs, HiveMQ and
OshExtensionkeep the client subscriptions. The new handler never gotonSubscribefor them, so it published nothing to those clients. A new SUBSCRIBE to the same topic was accepted but did not help, because the topic was already recorded. The client had to unsubscribe and subscribe again, or reconnect. This affects every module that registers a handler.Fix
OshExtensionkeeps the user of each client subscription.registerHandlercallsonSubscribefor the existing subscriptions under the prefix of the new handler.onSubscribefails (for example, the resource is gone or the user lost the permission), the subscription is removed from the client in HiveMQ.Testing
TestOshExtension:Merge order