Skip to content

Commit b1115b3

Browse files
authored
fix: improve career break inference in stint changes (#4087)
1 parent 1bd18ad commit b1115b3

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

services/libs/common_services/src/services/member-organization.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,15 @@ export function inferMemberOrganizationStintChanges(
213213
return false
214214
}
215215

216-
// Wide umbrella orgs that fully wrap the neighbor are concurrent, not career breaks
217-
if (s.dateStart <= neighbor.dateStart && s.dateEnd >= neighbor.dateEnd) {
218-
return false
219-
}
220-
221216
const overlapStart = s.dateStart > gapStart ? s.dateStart : gapStart
222217
const overlapEnd = s.dateEnd < gapEnd ? s.dateEnd : gapEnd
218+
if (overlapStart >= overlapEnd) return false
219+
220+
// Wrapping orgs were already concurrent, so need >90d (vs >30d) to separate
221+
const isUmbrella = s.dateStart <= neighbor.dateStart && s.dateEnd >= neighbor.dateEnd
222+
const threshold = isUmbrella ? 90 : 30
223223

224-
return overlapStart < overlapEnd && diff(overlapStart, overlapEnd) > 30
224+
return diff(overlapStart, overlapEnd) > threshold
225225
})
226226

227227
if (hasSeparator) {

0 commit comments

Comments
 (0)