Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix messageId allocate twice on deliver.
When resubscribe options is true, then the previous subscriptions are automatically re-subscribed. During that process, deliver() is called. In deliver(), send the packet is the queue. Queued packet could be publish, pubrel, subscribe, or unsubscribe. If the packet is publish or pubrel, its messageId should be registered to messageIdProvider because messageIdProvider doesn't know it. If the packet is subscribe, the messageId has already been allocated from messageIdProvider during re-subscribing process. So messageIdProvider knows the messageId. deliver() didn't check the packet command so even if the packet command is subscribe, so it tried to register the already allocated messageId. This PR checks the packet command before registering messageId.
- Loading branch information