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
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 inparamsinto all methods related to listing subscriptions, such aslistSubscriptionsandlistSubscriptionsAsync. They may choose to adddeviceId: "some device id"as a param, or leave device ID blank. Unfortunately, all these params are completely ignored/ forgotten about inlistSubscriptionsImpl. It will reset thedeviceIdin 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