Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

NPE when calling unsubscribe() while not subcribed #131

Open
@StephanSchuster

Description

@StephanSchuster

Calling
client.getEventHandler().unsubscribe("my/event", mMyListener)
without having called
client.getEventHandler().subscribe("my/event", mMyListener)
before, results in an NPE in
DeepstreamClientAbstract.onError(...)

Reason: The server sends NOT_SUBSCRIBED which is an event type that is not known by the respective Event enum on the client. Maybe this is already a bug. I'm not sure because on https://deepstreamhub.com/docs/server/constants-and-errors/ there is no check behind NOT_SUBSCRIBED for the client (whatever that means). In any case the client should handle such situations more gracefully with throwing a DeepstreamError instead of crashing with a NPE.

In contrast to other open issues there is no workaround for this by extending and fixing the client. All relevant methods cannot be overriden due to access rights. Therefore it would be very helpful if someone could fix and release this (maybe together with a few other issues).

I'll provide a patch shortly.

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