Skip to content

chore: Salesforce - optimize getContact method [CAL-4940] #42033

chore: Salesforce - optimize getContact method [CAL-4940]

chore: Salesforce - optimize getContact method [CAL-4940] #42033

Triggered via pull request December 20, 2024 07:18
@joeauyeungjoeauyeung
synchronize #18289
Status Failure
Total duration 6m 27s
Artifacts 1

pr.yml

on: pull_request_target
Detect changes
12s
Detect changes
Check for E2E label
1s
Check for E2E label
Install dependencies  /  Yarn install & cache
1m 47s
Install dependencies / Yarn install & cache
Production builds  /  Build Web App
Production builds / Build Web App
Production builds  /  Build API v1
Production builds / Build API v1
Production builds  /  Build API v2
Production builds / Build API v2
Type check  /  check-types
2m 32s
Type check / check-types
Linters  /  lint
2m 9s
Linters / lint
Tests  /  Unit
1m 51s
Tests / Unit
Production builds  /  Build Atoms
Production builds / Build Atoms
Production builds  /  Build Docs
Production builds / Build Docs
Analyze Build  /  analyze
Analyze Build / analyze
Matrix: Tests / e2e
Waiting for pending jobs
Tests  /  E2E App Store
Tests / E2E App Store
Tests  /  E2E Embed Core
Tests / E2E Embed Core
Tests  /  E2E Embed React
Tests / E2E Embed React
Tests  /  E2E API v2
Tests / E2E API v2
Tests  /  Integration
Tests / Integration
Merge reports  /  merge-reports
Merge reports / merge-reports
required
4s
required
Publish HTML report  /  publish-report
Publish HTML report / publish-report
Fit to window
Zoom out
Zoom in

Annotations

13 errors
apps/web/lib/__tests__/getTeamMemberEmailFromCrm.test.ts > getTeamMemberEmailForResponseOrContactUsingUrlQuery > should return CRM owner email when valid: apps/web/lib/getTeamMemberEmailFromCrm.ts#L38
TypeError: Cannot read properties of undefined (reading 'find') ❯ findUserByEmailWhoIsAHostOfEventType apps/web/lib/getTeamMemberEmailFromCrm.ts:38:28 ❯ getOwnerEmailFromCrm apps/web/lib/getTeamMemberEmailFromCrm.ts:125:35 ❯ getTeamMemberEmailForResponseOrContact apps/web/lib/getTeamMemberEmailFromCrm.ts:217:12 ❯ Module.getTeamMemberEmailForResponseOrContactUsingUrlQuery apps/web/lib/getTeamMemberEmailFromCrm.ts:243:10 ❯ apps/web/lib/__tests__/getTeamMemberEmailFromCrm.test.ts:216:20
apps/web/lib/__tests__/getTeamMemberEmailFromCrm.test.ts > getTeamMemberEmailForResponseOrContactUsingUrlQuery > should return null when CRM owner is not found: apps/web/lib/getTeamMemberEmailFromCrm.ts#L38
TypeError: Cannot read properties of undefined (reading 'find') ❯ findUserByEmailWhoIsAHostOfEventType apps/web/lib/getTeamMemberEmailFromCrm.ts:38:28 ❯ getOwnerEmailFromCrm apps/web/lib/getTeamMemberEmailFromCrm.ts:125:35 ❯ getTeamMemberEmailForResponseOrContact apps/web/lib/getTeamMemberEmailFromCrm.ts:217:12 ❯ Module.getTeamMemberEmailForResponseOrContactUsingUrlQuery apps/web/lib/getTeamMemberEmailFromCrm.ts:243:10 ❯ apps/web/lib/__tests__/getTeamMemberEmailFromCrm.test.ts:229:20
apps/web/lib/__tests__/getTeamMemberEmailFromCrm.test.ts > getTeamMemberEmailForResponseOrContactUsingUrlQuery > should return null when CRM owner is not part of event type: apps/web/lib/getTeamMemberEmailFromCrm.ts#L38
TypeError: Cannot read properties of undefined (reading 'find') ❯ findUserByEmailWhoIsAHostOfEventType apps/web/lib/getTeamMemberEmailFromCrm.ts:38:28 ❯ getOwnerEmailFromCrm apps/web/lib/getTeamMemberEmailFromCrm.ts:125:35 ❯ getTeamMemberEmailForResponseOrContact apps/web/lib/getTeamMemberEmailFromCrm.ts:217:12 ❯ Module.getTeamMemberEmailForResponseOrContactUsingUrlQuery apps/web/lib/getTeamMemberEmailFromCrm.ts:243:10 ❯ apps/web/lib/__tests__/getTeamMemberEmailFromCrm.test.ts:242:20
apps/web/lib/__tests__/getTeamMemberEmailFromCrm.test.ts > getTeamMemberEmailForResponseOrContactUsingUrlQuery > Booking form handler > should return teamMember email through booking form handler when cal.routingFormResponseId and cal.salesforce.xxxx=true is provided: apps/web/lib/getTeamMemberEmailFromCrm.ts#L38
TypeError: Cannot read properties of undefined (reading 'find') ❯ findUserByEmailWhoIsAHostOfEventType apps/web/lib/getTeamMemberEmailFromCrm.ts:38:28 ❯ getTeamMemberEmailUsingRoutingFormHandler apps/web/lib/getTeamMemberEmailFromCrm.ts:166:27 ❯ getTeamMemberEmailForResponseOrContact apps/web/lib/getTeamMemberEmailFromCrm.ts:205:53 ❯ Module.getTeamMemberEmailForResponseOrContactUsingUrlQuery apps/web/lib/getTeamMemberEmailFromCrm.ts:243:10 ❯ apps/web/lib/__tests__/getTeamMemberEmailFromCrm.test.ts:279:22
apps/web/lib/__tests__/getTeamMemberEmailFromCrm.test.ts > getTeamMemberEmailForResponseOrContactUsingUrlQuery > Booking form handler > should return null when when cal.routingFormResponseId and cal.salesforce.xxxx=true is provided but the returned email isn't an event member: apps/web/lib/getTeamMemberEmailFromCrm.ts#L38
TypeError: Cannot read properties of undefined (reading 'find') ❯ findUserByEmailWhoIsAHostOfEventType apps/web/lib/getTeamMemberEmailFromCrm.ts:38:28 ❯ getTeamMemberEmailUsingRoutingFormHandler apps/web/lib/getTeamMemberEmailFromCrm.ts:166:27 ❯ getTeamMemberEmailForResponseOrContact apps/web/lib/getTeamMemberEmailFromCrm.ts:205:53 ❯ Module.getTeamMemberEmailForResponseOrContactUsingUrlQuery apps/web/lib/getTeamMemberEmailFromCrm.ts:243:10 ❯ apps/web/lib/__tests__/getTeamMemberEmailFromCrm.test.ts:361:22
packages/app-store/salesforce/lib/CrmService.test.ts > SalesforceCRMService > getContacts > should return empty array when no records found: packages/app-store/salesforce/lib/CrmService.test.ts#L52
AssertionError: expected "spy" to be called with arguments: [ Array(1) ] Received: 1st spy call: Array [ - "SELECT Id, Email, OwnerId FROM Contact WHERE Email IN ('test@example.com')", + "SELECT Id, Email, OwnerId, Owner.Email FROM Contact WHERE Email IN ('test@example.com')", ] Number of calls: 1 ❯ packages/app-store/salesforce/lib/CrmService.test.ts:52:36
packages/app-store/salesforce/lib/CrmService.test.ts > SalesforceCRMService > getContacts > should handle single email string input: packages/app-store/salesforce/lib/CrmService.test.ts#L85
AssertionError: expected "spy" to be called with arguments: [ Array(1) ] Received: 1st spy call: Array [ - "SELECT Id, Email, OwnerId FROM Contact WHERE Email IN ('test@example.com')", + "SELECT Id, Email, OwnerId, Owner.Email FROM Contact WHERE Email IN ('test@example.com')", ] Number of calls: 1 ❯ packages/app-store/salesforce/lib/CrmService.test.ts:85:24
packages/app-store/salesforce/lib/CrmService.test.ts > SalesforceCRMService > getContacts > should handle array of emails input: packages/app-store/salesforce/lib/CrmService.test.ts#L128
AssertionError: expected "spy" to be called with arguments: [ Array(1) ] Received: 1st spy call: Array [ - "SELECT Id, Email, OwnerId FROM Contact WHERE Email IN ('test1@example.com','test2@example.com')", + "SELECT Id, Email, OwnerId, Owner.Email FROM Contact WHERE Email IN ('test1@example.com','test2@example.com')", ] Number of calls: 1 ❯ packages/app-store/salesforce/lib/CrmService.test.ts:128:24
packages/app-store/salesforce/lib/CrmService.test.ts > SalesforceCRMService > getContacts > should include owner information when includeOwner is true: packages/app-store/salesforce/lib/CrmService.test.ts#L166
AssertionError: expected [ { id: '001', …(4) } ] to deeply equal [ { id: '001', …(4) } ] - Expected + Received Array [ Object { "email": "test@example.com", "id": "001", - "ownerEmail": "owner@example.com", + "ownerEmail": undefined, "ownerId": "owner001", "recordType": "Contact", }, ] ❯ packages/app-store/salesforce/lib/CrmService.test.ts:166:22
packages/app-store/salesforce/lib/CrmService.test.ts > SalesforceCRMService > getContacts > should handle account record type with round robin skip: packages/app-store/salesforce/lib/CrmService.test.ts#L244
AssertionError: expected [ { id: '001', …(4) } ] to deeply equal [ { id: 'acc001', …(4) } ] - Expected + Received Array [ Object { "email": "test@example.com", - "id": "acc001", - "ownerEmail": "owner@example.com", + "id": "001", + "ownerEmail": undefined, "ownerId": "owner001", - "recordType": "Account", + "recordType": "Contact", }, ] ❯ packages/app-store/salesforce/lib/CrmService.test.ts:244:22
Linters / lint
Process completed with exit code 1.
Type check / check-types
Process completed with exit code 2.
required
Process completed with exit code 1.

Artifacts

Produced during runtime
Name Size
lint-results
495 KB