Skip to content

push.listSubscriptionsImpl method not respecting params #705

@uxduck

Description

@uxduck

Introduction

Users may decide to list push subscriptions by clientId or deviceId. In ably-java, this is currently not possible, and a request to listSubscriptions by clientId or deviceId will return a list of both.

Implementation/ bug

In PushChannel.java, A user has the option to pass in params into all methods related to listing subscriptions, such as listSubscriptions and listSubscriptionsAsync. They may choose to add deviceId: "some device id" as a param, or leave device ID blank. Unfortunately, all these params are completely ignored/ forgotten about in listSubscriptionsImpl. It will reset the deviceId in params, even if it were not set. This results in all subscriptions being listed and sent back to the device.

Proposed solution

If params are passed in, they should be respected, if no deviceID is added, ably-java should not add deviceId to the params sent in the HTTP request.

Optionally, we could add a convenience method, listSubscriptions() with no arguments which returns all subscriptions by the device or client ID.

┆Issue is synchronized with this Jira Bug by Unito

Metadata

Metadata

Assignees

Labels

bugSomething isn't working. It's clear that this does need to be fixed.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions