-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add batch delete conversations endpoint #58
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
Adds POST /v1/conversations/batch-delete endpoint support: - TypeScript: batchDeleteConversations(ids: string[]) function and types - Rust: batch_delete_conversations(ids: Vec<String>) method and types - Exports types from index.ts and adds to OpenSecretProvider context - Integration test covering success and partial failure cases Closes #57 Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
📝 WalkthroughWalkthroughThis PR adds batch deletion support for conversations across the Rust and TypeScript SDKs. It introduces new types and methods ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
🧰 Additional context used🧬 Code graph analysis (3)rust/src/client.rs (2)
rust/src/types.rs (2)
src/lib/test/integration/ai.test.ts (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (10)
Comment |
Deploying opensecret-sdk with
|
| Latest commit: |
8904fd3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://cee44975.opensecret-sdk.pages.dev |
| Branch Preview URL: | https://feat-batch-delete-conversati.opensecret-sdk.pages.dev |
Greptile SummaryThis PR implements a batch delete conversations endpoint across both TypeScript and Rust SDKs. The implementation adds the ability to delete multiple conversations in a single API call with per-item result handling for partial failures. Key Changes
Implementation QualityThe implementation follows existing patterns in the codebase consistently. The TypeScript implementation uses the standard The test coverage is thorough, validating both happy path (successful batch deletion) and error handling (non-existent conversation IDs returning Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client as SDK Client
participant API as batchDeleteConversations()
participant Backend as API Server
participant DB as Database
Client->>API: batchDeleteConversations(ids[])
API->>API: Create request payload
API->>Backend: POST /v1/conversations/batch-delete
Backend->>Backend: Validate user permissions
loop For each conversation ID
Backend->>DB: Query and remove conversation
alt Success
DB-->>Backend: Conversation removed
Backend->>Backend: Add result: deleted=true
else Not found
DB-->>Backend: Not found
Backend->>Backend: Add result: deleted=false, error=not_found
else Failure
DB-->>Backend: Database error
Backend->>Backend: Add result: deleted=false, error=delete_failed
end
end
Backend->>Backend: Build response with all results
Backend-->>API: BatchDeleteConversationsResponse
API-->>Client: Return per-item results
|
Summary
Implements the batch delete conversations endpoint as specified in #57.
Changes
TypeScript SDK
BatchDeleteConversationsRequest,BatchDeleteItemResult, andBatchDeleteConversationsResponsetypesbatchDeleteConversations(ids: string[])function inapi.tsindex.tsOpenSecretContextTypeandOpenSecretProviderinmain.tsxRust SDK
types.rsbatch_delete_conversations(ids: Vec<String>)method inclient.rsTests
not_founderror)API
Closes #57
Summary by CodeRabbit
Release Notes
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.