You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was just looking for a way to ensure that all channels have been detached and released before I try to re-authorize the client with a different set of capabilities. I found that the actual instance of my realtime client provides a .all property on the channels object. But it's not exposed through the typescript definitions.
Is this intended behaviour or do I need to use a different way to instantiate my client?
Hi @bastiankistner, channels.all is not part of the public API of the library. If you wish to perform an operation on all channels, I'd suggest that you keep your own list of the channels that you've instantiated (i.e. you should add to this list each time you call channels.get()).
As far as I know, this is not a feature that is frequently requested, so I’d like to understand your use case a bit better. What's your motivation for needing to "ensure that all channels have been detached and released before (you) try to re-authorize the client with a different set of capabilities"?
I'm building a collaborative realtime multichannel ecommerce fulfillment application that is supposed to handle market orders in batches and allows for multi-tenancy. The latter is the reason why I need to switch capabilities and re-authorize.
I'm using ably's realtime communication for the following aspects:
to ensure that only a single client for a single user can ever use the system at the same time to keep the amount of sent messages as low as possible (lead management)
sending printjobs from the web browser to a rust based cross platform print client that acts as a cloud print server
synchronize locking of orders to avoid conflicts
synchronize the order status across clients and instruct them to refresh their data from the cloud database
Since a user can be part of multiple organizations, each with a different set of marketplaces and potential connected print clients, I have to tear down all channels when the user switches the organization and re-establish a newly authorized connection with the corresponding channels.
It took me a while to properly integrate ably into my system and I realized that I need more control over what's happening, which is why I turned from the react sdk to the plain js sdk. And to further increase transparency I was looking for ways that the sdk offers that could be of value. Then I stumbled upon the channels.all property and was wondering why ably doesn't publicly expose it as it would already provide a great tool to track channel usage.
I was just looking for a way to ensure that all channels have been detached and released before I try to re-authorize the client with a different set of capabilities. I found that the actual instance of my realtime client provides a
.all
property on the channels object. But it's not exposed through the typescript definitions.Is this intended behaviour or do I need to use a different way to instantiate my client?
Here is the particular code I'm talking about:
ably-js/src/common/lib/client/baserealtime.ts
Line 93 in 186de0b
and I instantiate the client as mentioned in the docs:
┆Issue is synchronized with this Jira Task by Unito
The text was updated successfully, but these errors were encountered: