Skip to content

Commit a3fc04a

Browse files
authored
fix: gracefully handle duplicate identity errors in LF Auth0 enrichment (CM-1017) (#3934)
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
1 parent 6fa8cb2 commit a3fc04a

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

services/apps/members_enrichment_worker/src/activities/lf-auth0/enrichLFAuth0.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,14 @@ export async function updateMemberWithEnrichmentData(
3232
try {
3333
await svc.postgres.writer.connection().tx(async (tx) => {
3434
for (const identity of identities) {
35-
await createMemberIdentity(
36-
new PgPromiseQueryExecutor(tx),
37-
{
38-
memberId,
39-
platform: identity.platform,
40-
value: identity.value,
41-
type: identity.type,
42-
verified: identity.verified || false,
43-
source: 'enrichment',
44-
},
45-
true,
46-
)
35+
await createMemberIdentity(new PgPromiseQueryExecutor(tx), {
36+
memberId,
37+
platform: identity.platform,
38+
value: identity.value,
39+
type: identity.type,
40+
verified: identity.verified || false,
41+
source: 'enrichment',
42+
})
4743
}
4844
if (attributes) {
4945
await updateMemberAttributes(tx, memberId, attributes)

0 commit comments

Comments
 (0)