feat(people): add "Don't auto-sync" option to employee sync source#3312
Merged
Conversation
CS-576 (re-open): customers could select an employee sync source in the
People tab but had no way to turn it back off. The only "off" levers were
disconnecting the integration (which also kills its compliance checks and is
labelled "remove all data") or an email-filter workaround — neither is a real
disable. The org-level `employeeSyncProvider` already supports null end-to-end
(`POST /employee-sync-provider {provider:null}` + `setSyncProvider(null)`), and
the daily 7 AM cron skips orgs whose provider is null — it was just never wired
to a UI control.
This adds a "Don't auto-sync" item to the sync-source dropdown that clears the
provider (stopping the scheduled sync) without disconnecting the integration or
touching already-imported people. Applies to every sync provider, not just
Entra. Selecting it routes to disable (never triggers a sync), and the hook now
confirms with a toast. Gated by `canManageMembers`; backend still enforces
`integration:update`.
Tests: cover setSyncProvider(null) disabling + provider selection.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6zcF9bvPP1UwZgzK21cw1
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
cubic analysis
1 issue found across 3 files
Confidence score: 3/5
- In
apps/app/src/app/(app)/[orgId]/people/all/components/TeamMembersClient.tsx, the “Don’t auto-sync” path callssetSyncProvider(null)without settingisSyncing, so the dropdown stays interactive while the request is in flight; users can trigger overlapping changes and end up with inconsistent sync state or confusing UI feedback — setisSyncingbefore the API call and disable the control until the request settles before merging.
Linked issue analysis
Linked issue: CS-576: Entra Integration — Add ability to disable/limit auto-sync
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | Add a “Don't auto-sync” option to the sync-source dropdown and wire selection to disabling logic (call setSyncProvider(null)). | TeamMembersClient adds a NO_SYNC_VALUE SelectItem and the onValueChange branch handles that value by calling handleDisableSync -> setSyncProvider(null). |
| ✅ | Persist provider: null via the API so the scheduled daily sync will skip the org. | useEmployeeSync.send POSTs provider: null and tests verify the API call; setting provider to null is the mechanism the cron uses to skip orgs. |
| ✅ | Show an indicator ('Active') on the 'Don't auto-sync' item when no provider is selected (discoverability of off state). | The SelectItem renders a conditional 'Active' label when selectedProvider is falsy. |
| ✅ | Confirm disabling action with a success toast to the user. | useEmployeeSync now shows a success toast when provider is set to null and the test asserts the toast call. |
| Leave already-imported people untouched and keep the integration connected (so compliance checks continue). | PR description explicitly states imported people are left untouched and the integration remains connected; the diff shows only a provider-null API call (no deletion or disconnect logic), but there is no explicit test asserting compliance checks continue or that imported users are unchanged. | |
| ✅ | Permission-gate the dropdown so only users with manage-members can change the provider. | The Select is disabled using the existing canManageMembers guard (disabled={isSyncing || !canManageMembers}), so changing the provider (including selecting Don't auto-sync) remains permission-guarded. |
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Addresses cubic P2: the "Don't auto-sync" path called setSyncProvider(null) without any busy flag, so the dropdown stayed interactive during the request and a follow-up provider selection could race it to an inconsistent state. Add an isDisablingSync flag (mirroring isSyncing): set it around the disable request, include it in the Select's disabled guard, and bail out of the handler if a disable is already in flight. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M6zcF9bvPP1UwZgzK21cw1
Contributor
|
🎉 This PR is included in version 3.94.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CS-576 (re-opened). Customers can pick an employee sync source in the People tab, but once selected there is no way to turn it back off. The dropdown lists only connected providers and has no "none"/"disable" item; selecting one immediately syncs everyone. The only "off" levers today are:
So a customer who wants to stop the daily auto-sync while staying connected for checks has no path in the UI.
Root cause
The capability already exists end-to-end — it was just never wired to a control:
POST /v1/integrations/sync/employee-sync-provideraccepts{ provider: null }("pass null to disable employee sync").useEmployeeSync.setSyncProvider(null)already calls it.syncEmployeesSchedule) only runs for orgs whereemployeeSyncProvideris not null.The People-tab dropdown's
onValueChangeonly ever calledsyncEmployees(...), and the item list contained no "off" option.Fix
setSyncProvider(null)) instead of running a sync, clearing the org's provider so the scheduled job skips it.setSyncProvidernow confirms the off action with a toast.canManageMembers; the API still enforcesintegration:update.Not included (intentionally)
"Sync only specific Entra groups" — a separate, larger feature that requires editing the shared Entra
syncDefinition(Graph group-member resolution + a new variable + UI) and is tracked separately. This PR delivers the customer's core "stop the sync completely" ask.Tests
useEmployeeSync.test.ts:setSyncProvider(null)POSTs{ provider: null }and confirms; provider selection POSTs the slug.Fixes CS-576
🤖 Generated with Claude Code
Summary by cubic
Adds a “Don’t auto-sync” option to the People tab so orgs can pause daily employee imports without disconnecting the integration. This fulfills the “disable auto-sync” part of Linear CS-576 while keeping compliance checks running.
New Features
setSyncProvider(null)so the scheduled job skips the org; existing people remain.canManageMembers; API enforcesintegration:update.Bug Fixes
Written for commit 541a72f. Summary will update on new commits.