Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
invalid_published_request.forEach((publishData: any) => {
console.log(chalk.cyan(" CANCELING TIMEOUT PUBLISH REQUEST "));
const response = new PublishResponse({
responseHeader: { serviceResult: StatusCodes.BadTimeout }
});
this.send_response_for_request(publishData, response);
});
}
assert(!param.hasOwnProperty("availableSequenceNumbers"));
assert(param.hasOwnProperty("subscriptionId"));
assert(param.hasOwnProperty("sequenceNumber"));
assert(param.hasOwnProperty("notificationData"));
assert(param.hasOwnProperty("moreNotifications"));
const subscription = this.getSubscriptionById(param.subscriptionId);
const subscriptionId = param.subscriptionId;
const sequenceNumber = param.sequenceNumber;
const notificationData = param.notificationData;
const moreNotifications = param.moreNotifications;
const availableSequenceNumbers = subscription ? subscription.getAvailableSequenceNumbers() : [];
const response = new PublishResponse({
availableSequenceNumbers,
moreNotifications,
notificationMessage: {
notificationData,
publishTime: new Date(),
sequenceNumber
},
subscriptionId
});
if (this.pendingPublishRequestCount === 0) {
console.log(
chalk.bgRed.white.bold(
" -------------------------------- PUSHING PUBLISH RESPONSE FOR LATE ANSWER !"));
this._publish_response_queue.push(response);
private send_error_for_request(
publishData: PublishData,
statusCode: StatusCode
): void {
_assertValidPublishData(publishData);
this.send_response_for_request(publishData, new PublishResponse({
responseHeader: { serviceResult: statusCode }
}));
}