-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(kb): align bulk chunk operation with API response #2899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/document.tsx
Show resolved
Hide resolved
Greptile SummaryFixed
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as Document Component
participant Hook as useBulkChunkOperation
participant API as PATCH /api/knowledge/.../chunks
participant Service as batchChunkOperation
participant Cache as Query Client
UI->>Hook: bulkChunkMutation({ operation, chunkIds })
Hook->>API: PATCH request with operation & chunkIds
API->>Service: batchChunkOperation(documentId, operation, chunkIds)
Service-->>API: { processed, errors }
API-->>Hook: { operation, successCount, errorCount, processed, errors }
Hook->>UI: onSuccess(result)
alt operation is delete OR errorCount > 0
UI->>Cache: refreshChunks() - full invalidation
else successful enable/disable
UI->>Cache: updateChunk() for each chunk - optimistic update
end
UI->>UI: Clear selected chunks
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, 1 comment
Summary
resultsproperty)Type of Change
Testing
Tested manually
Checklist