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
11 changes: 8 additions & 3 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
changelog:
- date: 2025-11-20
version: v10.2.3
changes:
- type: improvement
text: "Enforce use of the `fetch` function from the context, which is not affected by APM monkey patching."
- date: 2025-11-19
version: v10.2.2
changes:
Expand Down Expand Up @@ -1364,7 +1369,7 @@ supported-platforms:
- 'Ubuntu 14.04 and up'
- 'Windows 7 and up'
version: 'Pubnub Javascript for Node'
version: '10.2.2'
version: '10.2.3'
sdks:
- full-name: PubNub Javascript SDK
short-name: Javascript
Expand All @@ -1380,7 +1385,7 @@ sdks:
- distribution-type: source
distribution-repository: GitHub release
package-name: pubnub.js
location: https://github.com/pubnub/javascript/archive/refs/tags/v10.2.2.zip
location: https://github.com/pubnub/javascript/archive/refs/tags/v10.2.3.zip
requires:
- name: 'agentkeepalive'
min-version: '3.5.2'
Expand Down Expand Up @@ -2051,7 +2056,7 @@ sdks:
- distribution-type: library
distribution-repository: GitHub release
package-name: pubnub.js
location: https://github.com/pubnub/javascript/releases/download/v10.2.2/pubnub.10.2.2.js
location: https://github.com/pubnub/javascript/releases/download/v10.2.3/pubnub.10.2.3.js
requires:
- name: 'agentkeepalive'
min-version: '3.5.2'
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v10.2.3
November 20 2025

#### Modified
- Enforce use of the `fetch` function from the context, which is not affected by APM monkey patching.

## v10.2.2
November 19 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.10.2.2.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.10.2.2.min.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.10.2.3.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.10.2.3.min.js

2. Configure your keys:

Expand Down
16 changes: 4 additions & 12 deletions dist/web/pubnub.js
Original file line number Diff line number Diff line change
Expand Up @@ -5436,7 +5436,7 @@
return base.PubNubFile;
},
get version() {
return '10.2.2';
return '10.2.3';
},
getVersion() {
return this.version;
Expand Down Expand Up @@ -5913,19 +5913,11 @@
}
if (this.transport !== 'fetch')
return;
// Keeping reference on current `window.fetch` function.
WebTransport.originalFetch = fetch.bind(window);
// Storing reference on original `fetch` function implementation as protection against APM lib monkey patching.
WebTransport.originalFetch = WebTransport.getOriginalFetch();
// Check whether `fetch` has been monkey patched or not.
if (this.isFetchMonkeyPatched()) {
WebTransport.originalFetch = WebTransport.getOriginalFetch();
if (this.isFetchMonkeyPatched())
logger.warn('WebTransport', "Native Web Fetch API 'fetch' function monkey patched.");
if (!this.isFetchMonkeyPatched(WebTransport.originalFetch)) {
logger.info('WebTransport', "Use native Web Fetch API 'fetch' implementation from iframe as APM workaround.");
}
else {
logger.warn('WebTransport', 'Unable receive native Web Fetch API. There can be issues with subscribe long-poll cancellation');
}
}
}
makeSendable(req) {
const abortController = new AbortController();
Expand Down
4 changes: 2 additions & 2 deletions dist/web/pubnub.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/core/components/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const makeConfiguration = (base, setupCryptoModule) => {
return base.PubNubFile;
},
get version() {
return '10.2.2';
return '10.2.3';
},
getVersion() {
return this.version;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pubnub",
"version": "10.2.2",
"version": "10.2.3",
"author": "PubNub <[email protected]>",
"description": "Publish & Subscribe Real-time Messaging with PubNub",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/core/components/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export const makeConfiguration = (
return base.PubNubFile;
},
get version(): string {
return '10.2.2';
return '10.2.3';
},
getVersion(): string {
return this.version;
Expand Down
18 changes: 3 additions & 15 deletions src/transport/web-transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,24 +105,12 @@ export class WebTransport implements Transport {

if (this.transport !== 'fetch') return;

// Keeping reference on current `window.fetch` function.
WebTransport.originalFetch = fetch.bind(window);
// Storing reference on original `fetch` function implementation as protection against APM lib monkey patching.
WebTransport.originalFetch = WebTransport.getOriginalFetch();

// Check whether `fetch` has been monkey patched or not.
if (this.isFetchMonkeyPatched()) {
WebTransport.originalFetch = WebTransport.getOriginalFetch();

if (this.isFetchMonkeyPatched())
logger.warn('WebTransport', "Native Web Fetch API 'fetch' function monkey patched.");

if (!this.isFetchMonkeyPatched(WebTransport.originalFetch)) {
logger.info('WebTransport', "Use native Web Fetch API 'fetch' implementation from iframe as APM workaround.");
} else {
logger.warn(
'WebTransport',
'Unable receive native Web Fetch API. There can be issues with subscribe long-poll cancellation',
);
}
}
}

makeSendable(req: TransportRequest): [Promise<TransportResponse>, CancellationController | undefined] {
Expand Down
Loading