Skip to content

Commit

Permalink
PubNub SDK v4.5.4 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
client-engineering-bot committed Sep 29, 2020
1 parent cd4f759 commit 4e071ee
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 5 deletions.
11 changes: 10 additions & 1 deletion .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
name: python
version: 4.5.3
version: 4.5.4
schema: 1
scm: github.com/pubnub/python
changelog:
- version: v4.5.4
date: Sep 29, 2020
changes:
-
text: "Add `suppress_leave_events` configuration option which can be used to opt-out presence leave call on unsubscribe."
type: feature
-
text: "Log out message decryption error and pass received message with `PNDecryptionErrorCategory` category to status listeners."
type: improvement
- version: v4.5.3
date: Aug 10, 2020
changes:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [v4.5.4](https://github.com/pubnub/python/releases/tag/v4.5.4)

[Full Changelog](https://github.com/pubnub/python/compare/v4.5.3...v4.5.4)

- 🌟️ Add `suppress_leave_events` configuration option which can be used to opt-out presence leave call on unsubscribe.
- ⭐️️ Log out message decryption error and pass received message with `PNDecryptionErrorCategory` category to status listeners.

## [v4.5.3](https://github.com/pubnub/python/releases/tag/v4.5.3)

[Full Changelog](https://github.com/pubnub/python/compare/v4.5.2...v4.5.3)
Expand Down
3 changes: 2 additions & 1 deletion pubnub/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ def adapt_unsubscribe_builder(self, unsubscribe_operation):

self._subscription_state.adapt_unsubscribe_builder(unsubscribe_operation)

self._send_leave(unsubscribe_operation)
if not self._pubnub.config.suppress_leave_events:
self._send_leave(unsubscribe_operation)

if self._subscription_state.is_empty():
self._region = None
Expand Down
1 change: 1 addition & 0 deletions pubnub/pnconfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def __init__(self):
self.reconnect_policy = PNReconnectionPolicy.NONE
self.daemon = False
self.disable_token_manager = False
self.suppress_leave_events = False

self.heartbeat_default_values = True
self._presence_timeout = PNConfiguration.DEFAULT_PRESENCE_TIMEOUT
Expand Down
2 changes: 1 addition & 1 deletion pubnub/pubnub_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

class PubNubCore:
"""A base class for PubNub Python API implementations"""
SDK_VERSION = "4.5.3"
SDK_VERSION = "4.5.4"
SDK_NAME = "PubNub-Python"

TIMESTAMP_DIVIDER = 1000
Expand Down
16 changes: 15 additions & 1 deletion pubnub/workers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import logging

from abc import abstractmethod

from .enums import PNStatusCategory, PNOperationType
from .models.consumer.common import PNStatus
from .models.consumer.pn_error_data import PNErrorData
from .utils import strip_right
from .models.consumer.pubsub import PNPresenceEventResult, PNMessageResult, PNSignalMessageResult, PNMessageActionResult
from .models.server.subscribe import SubscribeMessage, PresenceEnvelope
Expand Down Expand Up @@ -39,7 +43,17 @@ def _process_message(self, message_input):
if self._pubnub.config.cipher_key is None:
return message_input
else:
return self._pubnub.config.crypto.decrypt(self._pubnub.config.cipher_key, message_input)
try:
return self._pubnub.config.crypto.decrypt(self._pubnub.config.cipher_key, message_input)
except Exception as exception:
logger.warning("could not decrypt message: \"%s\", due to error %s" % (message_input, str(exception)))
pn_status = PNStatus()
pn_status.category = PNStatusCategory.PNDecryptionErrorCategory
pn_status.error_data = PNErrorData(str(exception), exception)
pn_status.error = True
pn_status.operation = PNOperationType.PNSubscribeOperation
self._listener_manager.announce_status(pn_status)
return message_input

def _process_incoming_payload(self, message):
assert isinstance(message, SubscribeMessage)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='pubnub',
version='4.5.3',
version='4.5.4',
description='PubNub Real-time push service in the cloud',
author='PubNub',
author_email='support@pubnub.com',
Expand Down

0 comments on commit 4e071ee

Please sign in to comment.