Skip to content

Commit

Permalink
PubNub SDK v1.1.3 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
client-engineering-bot committed May 11, 2020
1 parent 4cae8cd commit 6ed3f2e
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 14 deletions.
12 changes: 11 additions & 1 deletion .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
---
changelog:
-
changes:
-
text: "Fixes unsubscribeAll so its no longer modifying subscription list during iteration."
type: bug
-
text: "Fixes exports to include presence and channel group results."
type: bug
date: May 11, 20
version: v1.1.3
-
changes:
-
Expand Down Expand Up @@ -195,4 +205,4 @@ supported-platforms:
platforms:
- "Dart SDK >=2.6.0 <3.0.0"
version: "PubNub Dart SDK"
version: "1.1.2"
version: "1.1.3"
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [v1.1.3](https://github.com/pubnub/dart/releases/tag/v1.1.3)
May 11 2020

[Full Changelog](https://github.com/pubnub/dart/compare/v1.1.2...v1.1.3)

- 🐛 Fixes unsubscribeAll so its no longer modifying subscription list during iteration. Fixed the following issues reported by [@pushpendraKh](https://github.com/pushpendraKh): [#6](https://github.com/pubnub/dart/issues/6).
- 🐛 Fixes exports to include presence and channel group results.

## [v1.1.2](https://github.com/pubnub/dart/releases/tag/v1.1.2)
May 6 2020

Expand Down
7 changes: 6 additions & 1 deletion lib/pubnub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ export './src/dx/channel/channel_group.dart' show ChannelGroup;

export './src/dx/_endpoints/publish.dart' show PublishResult;
export './src/dx/_endpoints/presence.dart'
show HeartbeatResult, LeaveResult, StateInfo;
show HeartbeatResult, LeaveResult, HereNowResult, StateInfo;
export './src/dx/_endpoints/channel_group.dart'
show
ChannelGroupChangeChannelsResult,
ChannelGroupListChannelsResult,
ChannelGroupDeleteResult;
export './src/dx/_endpoints/signal.dart' show SignalResult;
export './src/dx/_endpoints/push.dart'
show
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Core {
NetworkModule networking;
ParserModule parser;

static String version = '1.1.2';
static String version = '1.1.3';

Core(
{Keyset defaultKeyset,
Expand Down
7 changes: 6 additions & 1 deletion lib/src/core/keyset.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class KeysetStore {
final Map<String, Keyset> _store = {};
String _defaultName;

/// Returns a list of all keysets in this store
List<Keyset> get keysets => _store.values.toList();

/// Adds a [keyset] named [name] to the store.
///
/// If [useAsDefault] is true, then it will be used as a default keyset.
Expand Down Expand Up @@ -73,7 +76,9 @@ class KeysetStore {

/// Iterate over each keyset.
void forEach(void Function(String, Keyset) callback) {
_store.forEach(callback);
for (var entry in _store.entries) {
callback(entry.key, entry.value);
}
}

Keyset _getDefault({bool throwOnNull}) {
Expand Down
2 changes: 0 additions & 2 deletions lib/src/dx/subscribe/envelope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ class Envelope {
dynamic userMeta;
dynamic originalMessage;

Envelope._();

Envelope.fromJson(dynamic object) {
shard = object['a'] as String;
subscriptionPattern = object['b'] as String;
Expand Down
8 changes: 4 additions & 4 deletions lib/src/dx/subscribe/manager/manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class SubscriptionManager {
ctx.update(ctx.payload);
})
..when('state.idle', 'enters').callback((ctx) {
_logger.info(
_logger.silly(
'Entering ${ctx.entering} from ${ctx.exiting} because of ${ctx.event}');

if (ctx.event == 'update') {
Expand All @@ -71,13 +71,13 @@ class SubscriptionManager {
if ((newContext['channels'].length > 0 ||
newContext['channelGroups'].length > 0)) {
if (_messagesController == null || _messagesController.isClosed) {
_logger.info('Creating the controller...');
_logger.silly('Creating the controller...');
_messagesController = StreamController.broadcast();
}
ctx.machine.send('fetch');
} else {
if (_messagesController != null) {
_logger.info('Disposing the controller...');
_logger.silly('Disposing the controller...');
_messagesController.close();
_messagesController = null;
}
Expand All @@ -90,7 +90,7 @@ class SubscriptionManager {
_SubscriptionMachine
..when('state.fetching').machine('request', _RequestMachine,
onBuild: (m, sm) {
_logger.info('Entering state.fetching');
_logger.silly('Entering state.fetching');
var params = SubscribeParams(keyset, m.context['timetoken'].value,
region: m.context['region'],
channels: m.context['channels'],
Expand Down
6 changes: 3 additions & 3 deletions lib/src/dx/subscribe/subscribe.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ mixin SubscribeDx on Core {

/// Unsubscribes from all channels and channel groups.
void unsubscribeAll() async {
super.keysets.forEach((key, value) async {
for (var sub in value.subscriptions) {
for (var keyset in keysets.keysets) {
for (var sub in [...keyset.subscriptions]) {
await sub.unsubscribe();
}
});
}
}

/// Announce in [channels] and [channelGroups] that a device linked to the UUID in the keyset left.
Expand Down
2 changes: 2 additions & 0 deletions lib/src/dx/subscribe/subscription.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class Subscription extends Disposable {
await _streamSubscription.cancel();

_streamSubscription = null;
} else {
_logger.warning('Tried unsubscribing from an inactive stream...');
}
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pubnub
description: PubNub SDK v5 for Dart lang (with Flutter support) that allows you to create real-time applications
version: 1.1.2
version: 1.1.3
homepage: https://www.pubnub.com/docs

environment:
Expand Down

0 comments on commit 6ed3f2e

Please sign in to comment.