Skip to content

Commit

Permalink
fix: reduce sourceMember polling timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jul 19, 2023
1 parent da721af commit 8e03967
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/shared/expectedSourceMembers.ts
Expand Up @@ -21,6 +21,10 @@ const typesToNoPollFor = [
'GlobalValueSetTranslation',
'AssignmentRules',
'InstalledPackage',
'DataCategoryGroup',
'ManagedContentType',
'CustomObjectTranslation',
'TopicsForObjects',
];

const typesNotToPollForIfNamespace = ['CustomLabels', 'CustomMetadata', 'DuplicateRule', 'WebLink'];
Expand All @@ -40,6 +44,20 @@ const isSpecialAuraXml = (filePath?: string): boolean =>
filePath.endsWith('.intf-meta.xml'))
);

// things that never have SourceMembers
const excludedKeys = [
'AppMenu__Salesforce1',
'Profile__Standard',
'Profile__Guest License User',
'CustomTab__standard-home',
'Profile__Minimum Access - Salesforce',
'Profile__Salesforce API Only System Integrations',
'AssignmentRules__Case',
'ListView__CollaborationGroup.All_ChatterGroups',
'CustomTab__standard-mailapp',
'ApexEmailNotifications__apexEmailNotifications',
];

export const calculateExpectedSourceMembers = (expectedMembers: RemoteSyncInput[]): Map<string, RemoteSyncInput> => {
const outstandingSourceMembers = new Map<string, RemoteSyncInput>();

Expand All @@ -60,6 +78,7 @@ export const calculateExpectedSourceMembers = (expectedMembers: RemoteSyncInput[
!(fileResponse.type === 'ReportType' && fileResponse.filePath?.includes('screen_flows_prebuilt_crt')) &&
// they're settings to mdapi, and FooSettings in sourceMembers
!fileResponse.type.includes('Settings') &&
!(fileResponse.type === 'NavigationMenu' && fileResponse.fullName.startsWith('SFDC_Default_Navigation_')) &&
// mdapi encodes these, sourceMembers don't have encoding
!isEncodedTypeWithPercentSign(fileResponse.type, fileResponse.filePath) &&
!(typesNotToPollForIfNamespace.includes(fileResponse.type) && fileResponse.filePath?.includes('__')) &&
Expand All @@ -73,11 +92,7 @@ export const calculateExpectedSourceMembers = (expectedMembers: RemoteSyncInput[
.filter(
(key) =>
// CustomObject could have been re-added by the key generator from one of its fields
!key.startsWith('CustomObject__') &&
key !== 'Profile__Standard' &&
key !== 'CustomTab__standard-home' &&
key !== 'AssignmentRules__Case' &&
key !== 'ListView__CollaborationGroup.All_ChatterGroups'
!key.startsWith('CustomObject__') && !excludedKeys.includes(key)
)
.map((key) => outstandingSourceMembers.set(key, member));
});
Expand Down

0 comments on commit 8e03967

Please sign in to comment.