Skip to content

Commit

Permalink
fix: telemetry condition to add query param
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitpubnub committed Feb 5, 2024
1 parent 9c6462f commit 2fd360e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
12 changes: 2 additions & 10 deletions src/core/components/telemetry_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,15 @@ export default class {
}

startLatencyMeasure(operationType, identifier) {
if (
operationType === operationConstants.PNSubscribeOperation ||
operationConstants.PNReceiveMessagesOperation ||
!identifier
) {
if (operationType === operationConstants.PNSubscribeOperation || !identifier) {
return;
}

this._trackedLatencies[identifier] = Date.now();
}

stopLatencyMeasure(operationType, identifier) {
if (
operationType === operationConstants.PNSubscribeOperation ||
operationConstants.PNReceiveMessagesOperation ||
!identifier
) {
if (operationType === operationConstants.PNSubscribeOperation || !identifier) {
return;
}

Expand Down
3 changes: 0 additions & 3 deletions src/core/constants/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,4 @@ export default {
PNAccessManagerRevokeToken: 'PNAccessManagerRevokeToken',
//

// subscription utilities
PNHandshakeOperation: 'PNHandshakeOperation',
PNReceiveMessagesOperation: 'PNReceiveMessagesOperation',
};
2 changes: 1 addition & 1 deletion src/core/endpoints/subscriptionUtils/handshake.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import operationConstants from '../../constants/operations';
import utils from '../../utils';

const endpoint = {
getOperation: () => operationConstants.PNHandshakeOperation,
getOperation: () => operationConstants.PNSubscribeOperation,

validateParams: (_, params) => {
if (!params?.channels && !params?.channelGroups) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/endpoints/subscriptionUtils/receiveMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import operationConstants from '../../constants/operations';
import utils from '../../utils';

const endpoint = {
getOperation: () => operationConstants.PNReceiveMessagesOperation,
getOperation: () => operationConstants.PNSubscribeOperation,

validateParams: (_, params) => {
if (!params?.channels && !params?.channelGroups) {
Expand Down

0 comments on commit 2fd360e

Please sign in to comment.