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
13 changes: 10 additions & 3 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---
changelog:
- date: 2025-04-15
version: v9.5.1
changes:
- type: bug
text: "Add missing `NoneRetryPolicy` static field for `PubNub` class."
- type: improvement
text: "`RetryPolicy.None` exported as a function to not affect tree-shaking and modules exclusion possibilities."
- date: 2025-04-15
version: v9.5.0
changes:
Expand Down Expand Up @@ -1222,7 +1229,7 @@ supported-platforms:
- 'Ubuntu 14.04 and up'
- 'Windows 7 and up'
version: 'Pubnub Javascript for Node'
version: '9.5.0'
version: '9.5.1'
sdks:
- full-name: PubNub Javascript SDK
short-name: Javascript
Expand All @@ -1238,7 +1245,7 @@ sdks:
- distribution-type: source
distribution-repository: GitHub release
package-name: pubnub.js
location: https://github.com/pubnub/javascript/archive/refs/tags/v9.5.0.zip
location: https://github.com/pubnub/javascript/archive/refs/tags/v9.5.1.zip
requires:
- name: 'agentkeepalive'
min-version: '3.5.2'
Expand Down Expand Up @@ -1909,7 +1916,7 @@ sdks:
- distribution-type: library
distribution-repository: GitHub release
package-name: pubnub.js
location: https://github.com/pubnub/javascript/releases/download/v9.5.0/pubnub.9.5.0.js
location: https://github.com/pubnub/javascript/releases/download/v9.5.1/pubnub.9.5.1.js
requires:
- name: 'agentkeepalive'
min-version: '3.5.2'
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## v9.5.1
April 15 2025

#### Fixed
- Add missing `NoneRetryPolicy` static field for `PubNub` class.

#### Modified
- `RetryPolicy.None` exported as a function to not affect tree-shaking and modules exclusion possibilities.

## v9.5.0
April 15 2025

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Watch [Getting Started with PubNub JS SDK](https://app.dashcam.io/replay/64ee0d2
npm install pubnub
```
* or download one of our builds from our CDN:
* https://cdn.pubnub.com/sdk/javascript/pubnub.9.5.0.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.9.5.0.min.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.9.5.1.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.9.5.1.min.js

2. Configure your keys:

Expand Down
85 changes: 84 additions & 1 deletion dist/web/pubnub.js
Original file line number Diff line number Diff line change
Expand Up @@ -3777,38 +3777,96 @@
Endpoint["Unknown"] = "UnknownEndpoint";
/**
* The endpoints to send messages.
*
* This is related to the following functionality:
* - `publish`
* - `signal`
* - `publish file`
* - `fire`
*/
Endpoint["MessageSend"] = "MessageSendEndpoint";
/**
* The endpoint for real-time update retrieval.
*
* This is related to the following functionality:
* - `subscribe`
*/
Endpoint["Subscribe"] = "SubscribeEndpoint";
/**
* The endpoint to access and manage `user_id` presence and fetch channel presence information.
*
* This is related to the following functionality:
* - `get presence state`
* - `set presence state`
* - `here now`
* - `where now`
* - `heartbeat`
*/
Endpoint["Presence"] = "PresenceEndpoint";
/**
* The endpoint to access and manage files in channel-specific storage.
*
* This is related to the following functionality:
* - `send file`
* - `download file`
* - `list files`
* - `delete file`
*/
Endpoint["Files"] = "FilesEndpoint";
/**
* The endpoint to access and manage messages for a specific channel(s) in the persistent storage.
*
* This is related to the following functionality:
* - `fetch messages / message actions`
* - `delete messages`
* - `messages count`
*/
Endpoint["MessageStorage"] = "MessageStorageEndpoint";
/**
* The endpoint to access and manage channel groups.
*
* This is related to the following functionality:
* - `add channels to group`
* - `list channels in group`
* - `remove channels from group`
* - `list channel groups`
*/
Endpoint["ChannelGroups"] = "ChannelGroupsEndpoint";
/**
* The endpoint to access and manage device registration for channel push notifications.
*
* This is related to the following functionality:
* - `enable channels for push notifications`
* - `list push notification enabled channels`
* - `disable push notifications for channels`
* - `disable push notifications for all channels`
*/
Endpoint["DevicePushNotifications"] = "DevicePushNotificationsEndpoint";
/**
* The endpoint to access and manage App Context objects.
*
* This is related to the following functionality:
* - `set UUID metadata`
* - `get UUID metadata`
* - `remove UUID metadata`
* - `get all UUID metadata`
* - `set Channel metadata`
* - `get Channel metadata`
* - `remove Channel metadata`
* - `get all Channel metadata`
* - `manage members`
* - `list members`
* - `manage memberships`
* - `list memberships`
*/
Endpoint["AppContext"] = "AppContextEndpoint";
/**
* The endpoint to access and manage reactions for a specific message.
*
* This is related to the following functionality:
* - `add message action`
* - `get message actions`
* - `remove message action`
*/
Endpoint["MessageReactions"] = "MessageReactionsEndpoint";
})(Endpoint || (Endpoint = {}));
Expand All @@ -3817,6 +3875,19 @@
* Failed request retry policy.
*/
class RetryPolicy {
static None() {
return {
shouldRetry(_request, _response, _errorCategory, _attempt) {
return false;
},
getDelay(_attempt, _response) {
return -1;
},
validate() {
return true;
},
};
}
static LinearRetryPolicy(configuration) {
var _a;
return {
Expand Down Expand Up @@ -4138,7 +4209,7 @@
return base.PubNubFile;
},
get version() {
return '9.5.0';
return '9.5.1';
},
getVersion() {
return this.version;
Expand Down Expand Up @@ -14648,6 +14719,11 @@
* API call status category.
*/
PubNubCore.CATEGORIES = StatusCategory$1;
/**
* Enum with API endpoint groups which can be used with retry policy to set up exclusions (which shouldn't be
* retried).
*/
PubNubCore.Endpoint = Endpoint;
/**
* Exponential retry policy constructor.
*/
Expand All @@ -14656,6 +14732,13 @@
* Linear retry policy constructor.
*/
PubNubCore.LinearRetryPolicy = RetryPolicy.LinearRetryPolicy;
/**
* Disabled / inactive retry policy.
*
* **Note:** By default `ExponentialRetryPolicy` is set for subscribe requests and this one can be used to disable
* retry policy for all requests (setting `undefined` for retry configuration will set default policy).
*/
PubNubCore.NoneRetryPolicy = RetryPolicy.None;

/**
* Cbor decoder module.
Expand Down
4 changes: 2 additions & 2 deletions dist/web/pubnub.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion lib/core/components/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const makeConfiguration = (base, setupCryptoModule) => {
var _a, _b, _c;
// Set default retry policy for subscribe (if new subscribe logic not used).
if (!base.retryConfiguration && base.enableEventEngine) {
const s = retryPolicy_1.RetryPolicy.None;
base.retryConfiguration = retryPolicy_1.RetryPolicy.ExponentialRetryPolicy({
minimumDelay: 2,
maximumDelay: 150,
Expand Down Expand Up @@ -143,7 +144,7 @@ const makeConfiguration = (base, setupCryptoModule) => {
return base.PubNubFile;
},
get version() {
return '9.5.0';
return '9.5.1';
},
getVersion() {
return this.version;
Expand Down
71 changes: 71 additions & 0 deletions lib/core/components/retryPolicy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,96 @@ var Endpoint;
Endpoint["Unknown"] = "UnknownEndpoint";
/**
* The endpoints to send messages.
*
* This is related to the following functionality:
* - `publish`
* - `signal`
* - `publish file`
* - `fire`
*/
Endpoint["MessageSend"] = "MessageSendEndpoint";
/**
* The endpoint for real-time update retrieval.
*
* This is related to the following functionality:
* - `subscribe`
*/
Endpoint["Subscribe"] = "SubscribeEndpoint";
/**
* The endpoint to access and manage `user_id` presence and fetch channel presence information.
*
* This is related to the following functionality:
* - `get presence state`
* - `set presence state`
* - `here now`
* - `where now`
* - `heartbeat`
*/
Endpoint["Presence"] = "PresenceEndpoint";
/**
* The endpoint to access and manage files in channel-specific storage.
*
* This is related to the following functionality:
* - `send file`
* - `download file`
* - `list files`
* - `delete file`
*/
Endpoint["Files"] = "FilesEndpoint";
/**
* The endpoint to access and manage messages for a specific channel(s) in the persistent storage.
*
* This is related to the following functionality:
* - `fetch messages / message actions`
* - `delete messages`
* - `messages count`
*/
Endpoint["MessageStorage"] = "MessageStorageEndpoint";
/**
* The endpoint to access and manage channel groups.
*
* This is related to the following functionality:
* - `add channels to group`
* - `list channels in group`
* - `remove channels from group`
* - `list channel groups`
*/
Endpoint["ChannelGroups"] = "ChannelGroupsEndpoint";
/**
* The endpoint to access and manage device registration for channel push notifications.
*
* This is related to the following functionality:
* - `enable channels for push notifications`
* - `list push notification enabled channels`
* - `disable push notifications for channels`
* - `disable push notifications for all channels`
*/
Endpoint["DevicePushNotifications"] = "DevicePushNotificationsEndpoint";
/**
* The endpoint to access and manage App Context objects.
*
* This is related to the following functionality:
* - `set UUID metadata`
* - `get UUID metadata`
* - `remove UUID metadata`
* - `get all UUID metadata`
* - `set Channel metadata`
* - `get Channel metadata`
* - `remove Channel metadata`
* - `get all Channel metadata`
* - `manage members`
* - `list members`
* - `manage memberships`
* - `list memberships`
*/
Endpoint["AppContext"] = "AppContextEndpoint";
/**
* The endpoint to access and manage reactions for a specific message.
*
* This is related to the following functionality:
* - `add message action`
* - `get message actions`
* - `remove message action`
*/
Endpoint["MessageReactions"] = "MessageReactionsEndpoint";
})(Endpoint || (exports.Endpoint = Endpoint = {}));
Expand All @@ -62,6 +120,19 @@ var Endpoint;
* Failed request retry policy.
*/
class RetryPolicy {
static None() {
return {
shouldRetry(_request, _response, _errorCategory, _attempt) {
return false;
},
getDelay(_attempt, _response) {
return -1;
},
validate() {
return true;
},
};
}
static LinearRetryPolicy(configuration) {
var _a;
return {
Expand Down
12 changes: 12 additions & 0 deletions lib/core/pubnub-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2216,6 +2216,11 @@ PubNubCore.OPERATIONS = operations_1.default;
* API call status category.
*/
PubNubCore.CATEGORIES = categories_1.default;
/**
* Enum with API endpoint groups which can be used with retry policy to set up exclusions (which shouldn't be
* retried).
*/
PubNubCore.Endpoint = retryPolicy_1.Endpoint;
/**
* Exponential retry policy constructor.
*/
Expand All @@ -2224,3 +2229,10 @@ PubNubCore.ExponentialRetryPolicy = retryPolicy_1.RetryPolicy.ExponentialRetryPo
* Linear retry policy constructor.
*/
PubNubCore.LinearRetryPolicy = retryPolicy_1.RetryPolicy.LinearRetryPolicy;
/**
* Disabled / inactive retry policy.
*
* **Note:** By default `ExponentialRetryPolicy` is set for subscribe requests and this one can be used to disable
* retry policy for all requests (setting `undefined` for retry configuration will set default policy).
*/
PubNubCore.NoneRetryPolicy = retryPolicy_1.RetryPolicy.None;
Loading
Loading