Tags: pubnub/python
Tags
Security fixes for decryption paths + VCR cassette compatibility (#235) fix: raises PubNubException('decryption error') on failure instead of returning the still-encrypted bytes fix: return one generic decryption error from cryptors instead of the crypto-library message test: strip dead python-object URL tags from asyncio VCR cassettes
Remove hard cap and honor configured retry intervals (#231) fix(reconnection): remove hard cap and honor configured retry intervals The retry limit was silently clamped to the policy default, configured intervals were ignored by delay calculators, and the async reconnection loop never checked the limit or advanced its counter — fix all three and add a `maximum_reconnection_interval` config option. refactor(publish): remove client-side publish sequence number (`seqn`) `seqn` is not required by PubNub REST API, so remove `PublishSequenceManager`, all its subclasses, `MAX_SEQUENCE`, and `seqn` injection.
`asyncio` and `native threads` timeout handling fix (#230) fix(asyncio): fix error propagation in async request path Ensure `PubNubAsyncioException` always carries a valid `PNStatus` with error data instead of `None`. fix(asyncio): fix `PubNubAsyncioException.__str__` crash Handle cases where status or `error_data` is `None` instead of raising `AttributeError`. fix(event-engine): fix error type checks in effects Match `PubNubAsyncioException` which is what `request_future` actually returns on failure. fix(event-engine): fix give-up logic for unlimited retries Handle `-1 (unlimited)` correctly since `attempts > -1` was always `true`, causing immediate give-up. fix(event-engine): initialize heartbeat max retry attempts Use delay class defaults instead of config value which could be `None` causing `TypeError` on comparison. fix(event-engine): add missing return after `heartbeat` give-up Prevent falling through to start a heartbeat after deciding to give up. fix(request-handlers): use explicit `httpx.Timeout` object Set all four timeout fields explicitly instead of a 2-tuple that left write and pool unset. fix(request-handlers): enforce wall-clock deadline to survive system sleep On macOS and Linux, `time.monotonic()` does not advance during system sleep, causing socket and `asyncio` timeouts (310s subscribe) to stall for hours of wall-clock time. Add `time.time()`-based deadline checks that detect sleep and cancel stale requests within ~5s of wake. fix(asyncio): replace `asyncio.wait_for` with wall-clock-aware loop Use `asyncio.wait()` with periodic `time.time()` checks instead of a single monotonic-based `wait_for()`, yielding to the event loop between checks. fix(native-threads): add `WallClockDeadlineWatchdog` Persistent single daemon thread monitors `time.time()` every 5s and closes the `httpx` session when the wall-clock deadline passes, interrupting the blocking socket read. Tracks deadlines per calling thread so concurrent requests (e.g., subscribe + publish) don't interfere. Only armed for long-timeout requests (>30s). Session is recreated for subsequent requests test(wall-clock-deadline): add unit tests for sleep detection Cover both `asyncio` and threads paths simulated clock jumps, normal passthrough, clean watchdog shutdown, per-thread deadline isolation, concurrent request independence, cleanup, and exception propagation. test(native-threads): add try/finally cleanup to subscribe tests Ensure `pubnub.stop()` always runs to prevent non-daemon threads from blocking process exit. test(native-threads): fix flaky where_now and here_now tests Enable presence heartbeat and use unique channel names so presence registers on the server. test(file-upload): fix shared state leak in file upload tests Restore `cipher_key` after use in `send_file` and pass it explicitly to `download_file`. test(message-actions): use unique channel names Avoid collisions with stale data from prior test runs.
Add `limit` and `offset` configuration options (#224) feat(here-now): add `limit` and `offset` configuration options Add `limit` (default `1000`) and `offset` parameters for `here_now` to fetch presence in portions. fix(subscribe-heartbeat): fix duplicated channels issue Fix issue because of which it was possible to add duplicated entries of `channels` and `groups` to the `subscribe`, `heartbeat`, and `leave` requests. feat(push-notifications): push type changes Add FCM push type support with GCM deprecation, and remove MPNS support due to its end of life. --------- Co-authored-by: jguz-pubnub <jakub.guz@pubnub.com>
Remove requirement to pass channels in pubnub.add_channels_to_push (#221 ) * Remove requirement to pass channels in pubnub.add_channels_to_push * Fix typo in remove_channels_from_push.sync() * Tests part 1. * Tests pt. 2 * Tests pt.3 * Tests pt.4 Final * Tests pt.4 Final-2 * PubNub SDK 10.4.1 release. --------- Co-authored-by: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com>
Introduce limit and next to ListFiles endpoint (#218) * Introduce limit and next to ListFiles endpoint * Asyncio tests * PubNub SDK 10.4.0 release. --------- Co-authored-by: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com>
PreviousNext