Skip to content

Commit 2a0535c

Browse files
authored
Fix issue with misplaced condition (#436)
fix(web-transport): fix issue with misplaced condition Fix issue because of which APM fix worked only when the client has been configured with `logVerbosity: true`.
1 parent 07b3418 commit 2a0535c

File tree

9 files changed

+30
-14
lines changed

9 files changed

+30
-14
lines changed

.pubnub.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
---
22
changelog:
3+
- date: 2025-02-10
4+
version: v8.8.1
5+
changes:
6+
- type: bug
7+
text: "Fix issue because of which APM fix worked only when the client has been configured with `logVerbosity: true`."
38
- date: 2025-02-05
49
version: v8.8.0
510
changes:
@@ -1132,7 +1137,7 @@ supported-platforms:
11321137
- 'Ubuntu 14.04 and up'
11331138
- 'Windows 7 and up'
11341139
version: 'Pubnub Javascript for Node'
1135-
version: '8.8.0'
1140+
version: '8.8.1'
11361141
sdks:
11371142
- full-name: PubNub Javascript SDK
11381143
short-name: Javascript
@@ -1148,7 +1153,7 @@ sdks:
11481153
- distribution-type: source
11491154
distribution-repository: GitHub release
11501155
package-name: pubnub.js
1151-
location: https://github.com/pubnub/javascript/archive/refs/tags/v8.8.0.zip
1156+
location: https://github.com/pubnub/javascript/archive/refs/tags/v8.8.1.zip
11521157
requires:
11531158
- name: 'agentkeepalive'
11541159
min-version: '3.5.2'
@@ -1819,7 +1824,7 @@ sdks:
18191824
- distribution-type: library
18201825
distribution-repository: GitHub release
18211826
package-name: pubnub.js
1822-
location: https://github.com/pubnub/javascript/releases/download/v8.8.0/pubnub.8.8.0.js
1827+
location: https://github.com/pubnub/javascript/releases/download/v8.8.1/pubnub.8.8.1.js
18231828
requires:
18241829
- name: 'agentkeepalive'
18251830
min-version: '3.5.2'

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v8.8.1
2+
February 10 2025
3+
4+
#### Fixed
5+
- Fix issue because of which APM fix worked only when the client has been configured with `logVerbosity: true`.
6+
17
## v8.8.0
28
February 05 2025
39

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ Watch [Getting Started with PubNub JS SDK](https://app.dashcam.io/replay/64ee0d2
2828
npm install pubnub
2929
```
3030
* or download one of our builds from our CDN:
31-
* https://cdn.pubnub.com/sdk/javascript/pubnub.8.8.0.js
32-
* https://cdn.pubnub.com/sdk/javascript/pubnub.8.8.0.min.js
31+
* https://cdn.pubnub.com/sdk/javascript/pubnub.8.8.1.js
32+
* https://cdn.pubnub.com/sdk/javascript/pubnub.8.8.1.min.js
3333
3434
2. Configure your keys:
3535

dist/web/pubnub.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,7 +3732,7 @@
37323732
return base.PubNubFile;
37333733
},
37343734
get version() {
3735-
return '8.8.0';
3735+
return '8.8.1';
37363736
},
37373737
getVersion() {
37383738
return this.version;
@@ -4202,9 +4202,11 @@
42024202
// Keeping reference on current `window.fetch` function.
42034203
WebTransport.originalFetch = fetch.bind(window);
42044204
// Check whether `fetch` has been monkey patched or not.
4205-
if (logVerbosity && this.isFetchMonkeyPatched()) {
4206-
console.warn("[PubNub] Native Web Fetch API 'fetch' function monkey patched.");
4205+
if (this.isFetchMonkeyPatched()) {
42074206
WebTransport.originalFetch = WebTransport.getOriginalFetch();
4207+
if (!logVerbosity)
4208+
return;
4209+
console.warn("[PubNub] Native Web Fetch API 'fetch' function monkey patched.");
42084210
if (!this.isFetchMonkeyPatched(WebTransport.originalFetch))
42094211
console.info("[PubNub] Use native Web Fetch API 'fetch' implementation from iframe as APM workaround.");
42104212
else

dist/web/pubnub.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/components/configuration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const makeConfiguration = (base, setupCryptoModule) => {
120120
return base.PubNubFile;
121121
},
122122
get version() {
123-
return '8.8.0';
123+
return '8.8.1';
124124
},
125125
getVersion() {
126126
return this.version;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pubnub",
3-
"version": "8.8.0",
3+
"version": "8.8.1",
44
"author": "PubNub <support@pubnub.com>",
55
"description": "Publish & Subscribe Real-time Messaging with PubNub",
66
"scripts": {

src/core/components/configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export const makeConfiguration = (
178178
return base.PubNubFile;
179179
},
180180
get version(): string {
181-
return '8.8.0';
181+
return '8.8.1';
182182
},
183183
getVersion(): string {
184184
return this.version;

src/transport/web-transport.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,13 @@ export class WebTransport implements Transport {
9696
WebTransport.originalFetch = fetch.bind(window);
9797

9898
// Check whether `fetch` has been monkey patched or not.
99-
if (logVerbosity && this.isFetchMonkeyPatched()) {
100-
console.warn("[PubNub] Native Web Fetch API 'fetch' function monkey patched.");
99+
if (this.isFetchMonkeyPatched()) {
101100
WebTransport.originalFetch = WebTransport.getOriginalFetch();
102101

102+
if (!logVerbosity) return;
103+
104+
console.warn("[PubNub] Native Web Fetch API 'fetch' function monkey patched.");
105+
103106
if (!this.isFetchMonkeyPatched(WebTransport.originalFetch))
104107
console.info("[PubNub] Use native Web Fetch API 'fetch' implementation from iframe as APM workaround.");
105108
else

0 commit comments

Comments
 (0)