Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions services/apps/data_sink_worker/src/service/activity.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,8 @@ export default class ActivityService extends LoggerBase {
// propagates out of prepareMemberData and crashes the entire batch, marking all other
// results in the batch with the same error even though they are valid.
if (!activity) {
this.log.error({ platform }, 'Activity data is missing.')
results.set(resultId, {
success: false,
err: new UnrepeatableError('Activity data is missing.'),
})
this.log.warn({ platform }, 'Activity data is missing, skipping and marking as processed.')
results.set(resultId, { success: true })
Comment thread
cursor[bot] marked this conversation as resolved.
continue
Comment thread
themarolt marked this conversation as resolved.
}

Expand Down Expand Up @@ -435,7 +432,22 @@ export default class ActivityService extends LoggerBase {
): Promise<Map<string, IProcessActivityResult>> {
const resultMap = new Map<string, IProcessActivityResult>()

let relevantPayloads = payloads
let relevantPayloads = payloads.filter((p) => {
if (!p.activity) {
this.log.warn(
{
resultId: p.resultId,
integrationId: p.integrationId,
segmentId: p.segmentId,
platform: p.platform,
},
'Activity data is missing, skipping and marking as processed.',
)
resultMap.set(p.resultId, { success: true })
return false
Comment thread
themarolt marked this conversation as resolved.
}
return true
})
Comment thread
themarolt marked this conversation as resolved.
this.log.trace(`[ACTIVITY] Processing ${relevantPayloads.length} activities!`)

const prepareMemberResults = this.prepareMemberData(relevantPayloads)
Expand Down
Loading