fix(knowledge): connector spinner race condition + connectors column#3812
fix(knowledge): connector spinner race condition + connectors column#3812waleedlatif1 merged 4 commits intostagingfrom
Conversation
PR SummaryLow Risk Overview Adds a Connectors column to the knowledge base list that renders registered connector icons with tooltips and enables sorting by connector count. Written by Cursor Bugbot for commit 959b7a8. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR fixes two race conditions in the connectors section of the knowledge base feature and adds a new Connectors column to the knowledge base list view.\n\n- Race condition fix (sync): Replaces the single Confidence Score: 5/5Safe to merge — all changes are isolated UI state fixes with no data-integrity risk. No P0 or P1 issues found. The per-connector Set state is implemented correctly with functional updates, server-side deduplication guarantees unique React keys, and the onSettled pattern is now consistent across both sync and update paths. Prior concern about inconsistent cleanup strategy was resolved in the head SHA. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User
participant CC as ConnectorCard (A)
participant CC2 as ConnectorCard (B)
participant CS as ConnectorsSection
participant TQ as TriggerSync Mutation
Note over CS: syncingIds = Set{}, updatingIds = Set{}
U->>CC: Click Sync (connector A)
CC->>CS: onSync(connectorA.id)
CS->>CS: addToSet(setSyncingIds, connectorA.id)
Note over CS: syncingIds = Set{"connectorA"}
CS->>TQ: triggerSync({knowledgeBaseId, connectorA.id})
CC-->>U: Sync button disabled for A only
U->>CC2: Click Sync (connector B) — now allowed!
CC2->>CS: onSync(connectorB.id)
CS->>CS: addToSet(setSyncingIds, connectorB.id)
Note over CS: syncingIds = Set{"connectorA","connectorB"}
CS->>TQ: triggerSync({knowledgeBaseId, connectorB.id})
TQ-->>CS: onSettled (connector A)
CS->>CS: removeFromSet(setSyncingIds, connectorA.id)
Note over CS: syncingIds = Set{"connectorB"}
TQ-->>CS: onSettled (connector B)
CS->>CS: removeFromSet(setSyncingIds, connectorB.id)
Note over CS: syncingIds = Set{}
Reviews (2): Last reviewed commit: "refactor(knowledge): use onSettled for s..." | Re-trigger Greptile |
.../workspace/[workspaceId]/knowledge/[id]/components/connectors-section/connectors-section.tsx
Show resolved
Hide resolved
|
@greptile |
|
@cursor review |
Summary
syncingConnectorIdstring withsyncingIdsSet — concurrent syncs on multiple connectors no longer raceisSyncing(fromuseTriggerSync().isPending) with per-connectorisSyncPending— syncing connector A no longer disables the sync button on connector BisUpdating(fromuseUpdateConnector().isPending) with per-connectorupdatingIdsSet — pausing connector A no longer disables the pause button on connector BisSyncPending || connector.status === 'syncing')addToSet/removeFromSethelpers to DRY up Set state mutationshandleTogglePausecallback (was 25-line inline handler)onSettledconsistently for bothsyncingIdsandupdatingIdscleanupType of Change
Testing
Tested manually
Checklist