Skip to content

Subscribing to valid, but forbidden topics deadlocks lib #25

@mzanetti

Description

@mzanetti

Trying to subscribe to e.g. "#" which at least according to awsiotsdk::mqtt::Subscription::IsValidTopicName() is a valid topic but according to the server policy my client is not authorized to subscribe to, results in no callbacks being called any more.
I could reproduce this with other topic ids too. I would have expected that the sdk would call my callback I provided on SubscribeAsync with an error code, or perhaps calls the disconnect callback or something, but it doesn't. In fact, subsequent [Publish|Subscribe]Async() calls callbacks are not called any more either until the sdk is shut down.

example log from my app with a allowed topic:

is connected true
topic to subscribe is "someallowed/topic/#" is valid topic: true
subscribe call queued with status: "Success : SDK Code 0." actionId: 2
publish call queued with status: "Success : SDK Code 0." actionId: 3
subscribeCallback for actionId 2 "Success : SDK Code 0."
publishCallback for actionId 3 "Success : SDK Code 0."
Received event from subscription: "someallowed/topic/MyNamespace.FakeMethod"

same app when trying to subscribe to something forbidden:

is connected true
topic to subscribe is "#" is valid topic: true
subscribe call queued with status: "Success : SDK Code 0." actionId: 2
publish call queued with status: "Success : SDK Code 0." actionId: 3

And that's it, I never get any callbacks called any more after this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions