Skip to content

Commit

Permalink
fix: Subscription failure while parsing presence Event (#124)
Browse files Browse the repository at this point in the history
* handling invalid presence event data in subscription

* PubNub SDK v4.3.4 release.

---------

Co-authored-by: PubNub Release Bot <[email protected]>
  • Loading branch information
mohitpubnub and pubnub-release-bot authored Apr 15, 2024
1 parent 508ae72 commit 691fb72
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
7 changes: 6 additions & 1 deletion .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
changelog:
- date: 2024-04-15
version: v4.3.4
changes:
- type: bug
text: "Fixes issue of parsing invalid presence data (which are not from pubnub server) in subscription."
- date: 2024-03-28
version: v4.3.3
changes:
Expand Down Expand Up @@ -447,7 +452,7 @@ supported-platforms:
platforms:
- "Dart SDK >=2.6.0 <3.0.0"
version: "PubNub Dart SDK"
version: "4.3.3"
version: "4.3.4"
sdks:
-
full-name: PubNub Dart SDK
Expand Down
6 changes: 6 additions & 0 deletions pubnub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v4.3.4
April 15 2024

#### Fixed
- Fixes issue of parsing invalid presence data (which are not from pubnub server) in subscription.

## v4.3.3
March 28 2024

Expand Down
2 changes: 1 addition & 1 deletion pubnub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To add the package to your Dart or Flutter project, add `pubnub` as a dependency

```yaml
dependencies:
pubnub: ^4.3.3
pubnub: ^4.3.4
```
After adding the dependency to `pubspec.yaml`, run the `dart pub get` command in the root directory of your project (the same that the `pubspec.yaml` is in).
Expand Down
2 changes: 1 addition & 1 deletion pubnub/lib/src/core/core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Core {
/// Internal module responsible for supervising.
SupervisorModule supervisor = SupervisorModule();

static String version = '4.3.3';
static String version = '4.3.4';

Core(
{Keyset? defaultKeyset,
Expand Down
7 changes: 4 additions & 3 deletions pubnub/lib/src/subscribe/subscription.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ class Subscription {
/// Will only emit when [withPresence] is true.
Stream<PresenceEvent> get presence => _envelopesController.stream
.where((envelope) =>
presenceChannels.contains(envelope.channel) ||
presenceChannels.contains(envelope.subscriptionPattern) ||
presenceChannelGroups.contains(envelope.subscriptionPattern))
envelope.userMeta != null &&
(presenceChannels.contains(envelope.channel) ||
presenceChannels.contains(envelope.subscriptionPattern) ||
presenceChannelGroups.contains(envelope.subscriptionPattern)))
.map<PresenceEvent>((envelope) => PresenceEvent.fromEnvelope(envelope));

final Completer<void> _cancelCompleter = Completer();
Expand Down
2 changes: 1 addition & 1 deletion pubnub/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: 4.3.3
version: 4.3.4
homepage: https://www.pubnub.com/docs/sdks/dart

environment:
Expand Down

0 comments on commit 691fb72

Please sign in to comment.