Skip to content

Commit 0c66e58

Browse files
harsh-joshi99kc-ong-taguchi
authored andcommitted
Cleanup the flagon code for hubspot object de-duplication (#3105)
1 parent 2ebff56 commit 0c66e58

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

packages/destination-actions/src/destinations/hubspot/upsertObject/constants.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ export const SUPPORTED_HUBSPOT_OBJECT_TYPES = [
1818
]
1919

2020
export const MAX_HUBSPOT_BATCH_SIZE = 100
21-
22-
export const HUBSPOT_DEDUPLICATION_FLAGON = 'hubspot-object-deduplication'

packages/destination-actions/src/destinations/hubspot/upsertObject/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ActionDefinition, RequestClient, IntegrationError, StatsContext, Features } from '@segment/actions-core'
1+
import { ActionDefinition, RequestClient, IntegrationError, StatsContext } from '@segment/actions-core'
22
import type { Settings } from '../generated-types'
33
import type { Payload } from './generated-types'
44
import { commonFields } from './common-fields'
@@ -16,7 +16,6 @@ import {
1616
sendAssociations
1717
} from './functions/hubspot-association-functions'
1818
import { getSchemaFromHubspot, createProperties } from './functions/hubspot-properties-functions'
19-
import { HUBSPOT_DEDUPLICATION_FLAGON } from './constants'
2019

2120
const action: ActionDefinition<Settings, Payload> = {
2221
title: 'Custom Object V2',
@@ -42,9 +41,9 @@ const action: ActionDefinition<Settings, Payload> = {
4241
},
4342
performBatch: async (request, data) => {
4443
const requestData = data as RequestData<Settings, Payload[]>
45-
const { payload, syncMode, subscriptionMetadata, statsContext, features, rawData } = requestData
44+
const { payload, syncMode, subscriptionMetadata, statsContext, rawData } = requestData
4645
statsContext?.tags?.push('action:custom_object_batch')
47-
return await send(request, payload, syncMode, subscriptionMetadata, statsContext, features, rawData)
46+
return await send(request, payload, syncMode, subscriptionMetadata, statsContext, rawData)
4847
}
4948
}
5049

@@ -54,10 +53,9 @@ const send = async (
5453
syncMode: SyncMode,
5554
subscriptionMetadata?: SubscriptionMetadata,
5655
statsContext?: StatsContext,
57-
features?: Features,
5856
rawData?: Payload[]
5957
) => {
60-
if (features && features[HUBSPOT_DEDUPLICATION_FLAGON] && (syncMode === 'upsert' || syncMode === 'update')) {
58+
if (syncMode === 'upsert' || syncMode === 'update') {
6159
payloads = ensureValidTimestamps(payloads, rawData)
6260
payloads = mergeAndDeduplicateById(payloads, statsContext)
6361
}

packages/destination-actions/src/destinations/hubspot/upsertObject/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Features, StatsContext } from '@segment/actions-core/*'
1+
import { StatsContext } from '@segment/actions-core/*'
22
import { Payload } from './generated-types'
33
import { SubscriptionMetadata } from '@segment/actions-core/destination-kit'
44

@@ -217,7 +217,6 @@ export interface RequestData<Settings, Payload> {
217217
syncMode: SyncMode
218218
subscriptionMetadata: SubscriptionMetadata
219219
statsContext?: StatsContext
220-
features?: Features
221220
settings: Settings
222221
}
223222

0 commit comments

Comments
 (0)