Skip to content

Commit

Permalink
fix(logger): for logger for Node.js
Browse files Browse the repository at this point in the history
Fix issue because of which `logVerbosity` set to `true` still didn't print logs for Node.js.
  • Loading branch information
parfeon committed Dec 17, 2024
1 parent 80a6be0 commit d9136fd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 1 addition & 3 deletions dist/web/pubnub.js
Original file line number Diff line number Diff line change
Expand Up @@ -6224,9 +6224,7 @@
delete payload.data;
}
else if ('action' in payload && payload.action === 'interval') {
// @ts-expect-error This is `interval` object which should have `hereNowRefresh` field.
payload['hereNowRefresh'] = (_a = payload.here_now_refresh) !== null && _a !== void 0 ? _a : false;
// @ts-expect-error Keeping only human-readable keys.
payload.hereNowRefresh = (_a = payload.here_now_refresh) !== null && _a !== void 0 ? _a : false;
delete payload.here_now_refresh;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class PubNub extends pubnub_common_1.PubNubCore {
if (process.env.CRYPTO_MODULE !== 'disabled')
cryptography = new node_2.default();
// Setup transport provider.
const transport = new node_transport_1.NodeTransport(configuration.keepAlive, configuration.keepAliveSettings);
const transport = new node_transport_1.NodeTransport(configuration.keepAlive, configuration.keepAliveSettings, clientConfiguration.logVerbosity);
const transportMiddleware = new middleware_1.PubNubMiddleware({
clientConfiguration,
tokenManager,
Expand Down
2 changes: 1 addition & 1 deletion lib/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5952,7 +5952,7 @@ declare namespace PubNub {
*/
status?: string;
/**
* Channel's membership type.
* Channel's member type.
*/
type?: string;
/**
Expand Down
6 changes: 5 additions & 1 deletion src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ class PubNub extends PubNubCore<string | ArrayBuffer | Buffer | Readable, PubNub
if (process.env.CRYPTO_MODULE !== 'disabled') cryptography = new NodeCryptography();

// Setup transport provider.
const transport = new NodeTransport(configuration.keepAlive, configuration.keepAliveSettings);
const transport = new NodeTransport(
configuration.keepAlive,
configuration.keepAliveSettings,
clientConfiguration.logVerbosity!,
);
const transportMiddleware = new PubNubMiddleware({
clientConfiguration,
tokenManager,
Expand Down
3 changes: 1 addition & 2 deletions test/integration/endpoints/subscribe.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ describe('subscribe endpoints', () => {
// @ts-expect-error Force override default value.
useRequestId: false,
autoNetworkDetection: false,
logVerbosity: true,
});
pubnubWithFiltering = new PubNub({
subscribeKey: 'mySubKey',
Expand Down Expand Up @@ -203,7 +202,7 @@ describe('subscribe endpoints', () => {
});
});

it('supports timetoken', (done) => {
it.only('supports timetoken', (done) => {
const scope0 = utils
.createNock()
.get('/v2/subscribe/mySubKey/c1/0')
Expand Down

0 comments on commit d9136fd

Please sign in to comment.