Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
cp sdk-specifications/features/subscribe/event-engine/happy-path_Legacy.feature tests/acceptance/subscribe/happy-path_Legacy.feature
cp sdk-specifications/features/presence/event-engine/presence-engine_Legacy.feature tests/acceptance/subscribe/presence-engine_Legacy.feature

sudo pip3 install -r requirements-dev.txt
pip3 install --user --ignore-installed -r requirements-dev.txt
behave --junit tests/acceptance/pam
behave --junit tests/acceptance/encryption/cryptor-module.feature -t=~na=python -k
behave --junit tests/acceptance/subscribe
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
python-version: "3.11"
- name: Install Python dependencies and run acceptance tests
run: |
sudo pip3 install -r requirements-dev.txt
pip3 install --user --ignore-installed -r requirements-dev.txt
flake8 --exclude=scripts/,src/,.cache,.git,.idea,.tox,._trial_temp/,venv/ --ignore F811,E402
- name: Cancel workflow runs for commit on error
if: failure()
Expand Down
13 changes: 9 additions & 4 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: python
version: 10.0.0
version: 10.0.1
schema: 1
scm: github.com/pubnub/python
sdks:
Expand All @@ -18,7 +18,7 @@ sdks:
distributions:
- distribution-type: library
distribution-repository: package
package-name: pubnub-10.0.0
package-name: pubnub-10.0.1
location: https://pypi.org/project/pubnub/
supported-platforms:
supported-operating-systems:
Expand Down Expand Up @@ -91,8 +91,8 @@ sdks:
-
distribution-type: library
distribution-repository: git release
package-name: pubnub-10.0.0
location: https://github.com/pubnub/python/releases/download/10.0.0/pubnub-10.0.0.tar.gz
package-name: pubnub-10.0.1
location: https://github.com/pubnub/python/releases/download/10.0.1/pubnub-10.0.1.tar.gz
supported-platforms:
supported-operating-systems:
Linux:
Expand Down Expand Up @@ -163,6 +163,11 @@ sdks:
license-url: https://github.com/encode/httpx/blob/master/LICENSE.md
is-required: Required
changelog:
- date: 2025-01-28
version: 10.0.1
changes:
- type: bug
text: "Fix issue because of which custom message type wasn't set to the parsed subscription response objects."
- date: 2025-01-13
version: 10.0.0
changes:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 10.0.1
January 28 2025

#### Fixed
- Fix issue because of which custom message type wasn't set to the parsed subscription response objects.

## 10.0.0
January 13 2025

Expand Down
5 changes: 3 additions & 2 deletions pubnub/models/consumer/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ class PNFileMessageResult(PNMessageResult):
def __init__(
self, message, subscription,
channel, timetoken, publisher,
file_url, file_id, file_name
file_url, file_id, file_name, user_metadata=None, custom_message_type=None
):
super(PNFileMessageResult, self).__init__(message, subscription, channel, timetoken, publisher=publisher)
super(PNFileMessageResult, self).__init__(message, subscription, channel, timetoken, user_metadata, publisher,
custom_message_type=custom_message_type)
self.file_url = file_url
self.file_id = file_id
self.file_name = file_name
Expand Down
3 changes: 3 additions & 0 deletions pubnub/models/server/subscribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def __init__(self):
self.subscribe_key = None
self.origination_timetoken = None
self.publish_metadata = None
self.user_metadata = None
self.only_channel_subscription = False
self.type = 0
self.custom_message_type = None
Expand All @@ -48,6 +49,8 @@ def from_json(cls, json_input):
if 'o' in json_input:
message.origination_timetoken = json_input['o']
message.publish_metadata = PublishMetadata.from_json(json_input['p'])
if 'u' in json_input:
message.user_metadata = json_input['u']
if 'e' in json_input:
message.type = json_input['e']
if 'cmt' in json_input:
Expand Down
10 changes: 6 additions & 4 deletions pubnub/pubnub.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,9 @@ def presence(self, pubnub, presence):
def wait_for_connect(self):
if not self.connected_event.is_set():
self.connected_event.wait()
else:
raise Exception("the instance is already connected")
# failing because you don't have to wait is illogical
# else:
# raise Exception("the instance is already connected")

def channel(self, pubnub, channel):
self.channel_queue.put(channel)
Expand All @@ -465,8 +466,9 @@ def membership(self, pubnub, membership):
def wait_for_disconnect(self):
if not self.disconnected_event.is_set():
self.disconnected_event.wait()
else:
raise Exception("the instance is already disconnected")
# failing because you don't have to wait is illogical
# else:
# raise Exception("the instance is already disconnected")

def wait_for_message_on(self, *channel_names):
channel_names = list(channel_names)
Expand Down
10 changes: 6 additions & 4 deletions pubnub/pubnub_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,14 +593,16 @@ async def _wait_for(self, coro):
async def wait_for_connect(self):
if not self.connected_event.is_set():
await self._wait_for(self.connected_event.wait())
else:
raise Exception("instance is already connected")
# failing because you don't have to wait is illogical
# else:
# raise Exception("instance is already connected")

async def wait_for_disconnect(self):
if not self.disconnected_event.is_set():
await self._wait_for(self.disconnected_event.wait())
else:
raise Exception("instance is already disconnected")
# failing because you don't have to wait is illogical
# else:
# raise Exception("instance is already disconnected")

async def wait_for_message_on(self, *channel_names):
channel_names = list(channel_names)
Expand Down
2 changes: 1 addition & 1 deletion pubnub/pubnub_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

class PubNubCore:
"""A base class for PubNub Python API implementations"""
SDK_VERSION = "10.0.0"
SDK_VERSION = "10.0.1"
SDK_NAME = "PubNub-Python"

TIMESTAMP_DIVIDER = 1000
Expand Down
9 changes: 8 additions & 1 deletion pubnub/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ def _process_incoming_payload(self, message: SubscribeMessage):
subscription=subscription_match,
timetoken=publish_meta_data.publish_timetoken,
publisher=message.issuing_client_id,
custom_message_type=message.custom_message_type,
user_metadata=message.user_metadata,
file_url=download_url,
file_id=extracted_message["file"]["id"],
file_name=extracted_message["file"]["name"]
Expand All @@ -182,7 +184,10 @@ def _process_incoming_payload(self, message: SubscribeMessage):
channel=channel,
subscription=subscription_match,
timetoken=publish_meta_data.publish_timetoken,
publisher=publisher
publisher=publisher,
custom_message_type=message.custom_message_type,
user_metadata=message.user_metadata,
error=error
)
self.announce(pn_signal_result)
return pn_signal_result
Expand All @@ -202,6 +207,8 @@ def _process_incoming_payload(self, message: SubscribeMessage):
subscription=subscription_match,
timetoken=publish_meta_data.publish_timetoken,
publisher=publisher,
custom_message_type=message.custom_message_type,
user_metadata=message.user_metadata,
error=error
)
self.announce(pn_message_result)
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='10.0.0',
version='10.0.1',
description='PubNub Real-time push service in the cloud',
author='PubNub',
author_email='[email protected]',
Expand Down
Loading
Loading