Skip to content

Commit 14d3f71

Browse files
authored
fix: unexpected soft-deleted github repos while updating integration [IN-998] (#3884)
1 parent 486e1fb commit 14d3f71

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

backend/src/services/integrationService.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2896,14 +2896,14 @@ export default class IntegrationService {
28962896

28972897
this.options.log.info(`Updated integration settings for integration id: ${integration.id}`)
28982898

2899-
// Update GitHub repos mapping
2899+
// Build full mapping: all repos (existing + new)
29002900
const defaultSegmentId = integration.segmentId
2901-
const mapping = {}
2902-
for (const repo of newRepos) {
2901+
const allRepos = [...currentRepos, ...newRepos]
2902+
const mapping: Record<string, string> = {}
2903+
for (const repo of allRepos) {
29032904
mapping[repo.url] = defaultSegmentId
29042905
}
2905-
if (Object.keys(mapping).length > 0) {
2906-
// false - not firing onboarding
2906+
if (newRepos.length > 0) {
29072907
await this.mapGithubRepos(integration.id, mapping, false)
29082908
this.options.log.info(`Updated GitHub repos mapping for integration id: ${integration.id}`)
29092909
} else {

0 commit comments

Comments
 (0)