Skip to content

Commit

Permalink
fix(web-transport): fix issue with misplaced condition
Browse files Browse the repository at this point in the history
Fix issue because of which APM fix worked only when client has been configured with `logVerbosity: true`.
  • Loading branch information
parfeon authored Feb 10, 2025
1 parent 07b3418 commit 65d2743
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/transport/web-transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ export class WebTransport implements Transport {
WebTransport.originalFetch = fetch.bind(window);

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

Check failure on line 101 in src/transport/web-transport.ts

View workflow job for this annotation

GitHub Actions / Integration and Unit tests (18.18.0, ci:node)

Delete `······`
if (!logVerbosity) return;

Check failure on line 103 in src/transport/web-transport.ts

View workflow job for this annotation

GitHub Actions / Integration and Unit tests (18.18.0, ci:node)

Delete `······`
console.warn("[PubNub] Native Web Fetch API 'fetch' function monkey patched.");

if (!this.isFetchMonkeyPatched(WebTransport.originalFetch))
console.info("[PubNub] Use native Web Fetch API 'fetch' implementation from iframe as APM workaround.");
Expand Down

0 comments on commit 65d2743

Please sign in to comment.