From 6b901c23d2b9d6cf677472913e1b2a90c40811d1 Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Sun, 28 Apr 2024 23:52:52 +0530 Subject: [PATCH] fix: job ordering for hs, initial commit --- src/v0/destinations/hs/transform.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/v0/destinations/hs/transform.js b/src/v0/destinations/hs/transform.js index 9eed244af4..2545e69055 100644 --- a/src/v0/destinations/hs/transform.js +++ b/src/v0/destinations/hs/transform.js @@ -1,7 +1,11 @@ const get = require('get-value'); const { InstrumentationError } = require('@rudderstack/integrations-lib'); const { EventType } = require('../../../constants'); -const { handleRtTfSingleEventError, getDestinationExternalIDInfoForRetl } = require('../../util'); +const { + handleRtTfSingleEventError, + getDestinationExternalIDInfoForRetl, + groupEventsByType: batchEventsInOrder, +} = require('../../util'); const { API_VERSION } = require('./config'); const { processLegacyIdentify, @@ -66,6 +70,7 @@ const process = async (event) => { // we are batching by default at routerTransform const processRouterDest = async (inputs, reqMetadata) => { + const tempNewInputs = batchEventsInOrder(inputs); let tempInputs = inputs; const successRespList = []; @@ -99,7 +104,7 @@ const processRouterDest = async (inputs, reqMetadata) => { } await Promise.all( - tempInputs.map(async (input) => { + tempNewInputs.map(async (input) => { try { if (input.message.statusCode) { // already transformed event