diff --git a/lib/src/common/src/channels.dart b/lib/src/common/src/channels.dart index b95a411c4..980cf13d4 100644 --- a/lib/src/common/src/channels.dart +++ b/lib/src/common/src/channels.dart @@ -40,9 +40,10 @@ abstract class Channels extends Iterable { /// Releases a [RestChannel] or [RealtimeChannel] object with a specified /// [name], deleting it. /// - /// It also removes any listeners associated with the channel. To release a - /// channel, the [ChannelState] must be `INITIALIZED`, `DETACHED`, or - /// `FAILED`. + /// It also removes any listeners associated with the channel. A realtime + /// channel should only be released when it is in the `INITIALIZED`, + /// `DETACHED`, or `FAILED` state; releasing a realtime channel in any other + /// state is deprecated and will throw an error in the next major version. void release(String name) { _channels.remove(name); } diff --git a/lib/src/platform/src/realtime/realtime_channels.dart b/lib/src/platform/src/realtime/realtime_channels.dart index caa31103b..093fe6686 100644 --- a/lib/src/platform/src/realtime/realtime_channels.dart +++ b/lib/src/platform/src/realtime/realtime_channels.dart @@ -19,9 +19,10 @@ class RealtimeChannels extends Channels { /// Releases a [RealtimeChannel] object with a specified [name], deleting it. /// - /// It also removes any listeners associated with the channel. To release a - /// channel, the [ChannelState] must be `INITIALIZED`, `DETACHED`, or - /// `FAILED`. + /// It also removes any listeners associated with the channel. A realtime + /// channel should only be released when it is in the `INITIALIZED`, + /// `DETACHED`, or `FAILED` state; releasing a realtime channel in any other + /// state is deprecated and will throw an error in the next major version. @override void release(String name) { realtime.invoke(PlatformMethod.releaseRealtimeChannel, {