Improve error handling of artifact deletion - #3157
Conversation
📝 WalkthroughWalkthroughThis change adds shared deletion checks and read-only warnings for gateway-created artifacts. It updates overview pages to block deletion when deployments or linked proxies exist, and updates list dialogs to show the same warning content and improved delete error messages. ChangesArtifact deletion guards
Estimated code review effort: 4 (Complex) | ~45 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant User
participant OverviewPage
participant PreconditionAPI
participant DeleteAPI
User->>OverviewPage: open artifact overview
OverviewPage->>PreconditionAPI: fetch deployments or linked proxies
PreconditionAPI-->>OverviewPage: return active counts
OverviewPage-->>User: disable delete or open confirmation dialog
User->>OverviewPage: confirm delete
OverviewPage->>DeleteAPI: delete artifact
DeleteAPI-->>OverviewPage: success or error
OverviewPage-->>User: show snackbar and navigate if deleted
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@portals/ai-workspace/src/pages/appShell/appShellPages/externalServers/ExternalServersList.tsx`:
- Around line 598-603: Add a deployment preflight to each delete flow so
confirmation is blocked when deployments are active, pending, or unavailable.
Update ExternalServersList, LLMProxiesList, and ProvidersList to query the
relevant deployments before enabling delete, and keep the existing warning
dialogs as secondary context rather than the only guard. In ProvidersList,
preserve the current linked-proxy check and add the read-only LLM Provider
deployment check alongside it.
In
`@portals/ai-workspace/src/pages/appShell/appShellPages/externalServers/ExternalServersOverview.tsx`:
- Around line 448-456: Treat unresolved deployment lookups as a blocked delete
state in ExternalServersOverview, LLMProxyOverview, and ServiceProviderOverview:
replace the current null/falsey handling around deleteBlockedReason so it
distinguishes loading, lookup failure, and zero active deployments, and only
enables deletion after a successful deployment check returns zero. In
ServiceProviderOverview, also revalidate deployment status in the delete
confirmation/preflight path before allowing the request through, and keep
deletion disabled on lookup failure while wiring in a retry path for the
deployment check.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 56043a0d-c859-487e-8fa0-c1618ff15b83
📒 Files selected for processing (8)
portals/ai-workspace/src/pages/appShell/appShellPages/externalServers/ExternalServersList.tsxportals/ai-workspace/src/pages/appShell/appShellPages/externalServers/ExternalServersOverview.tsxportals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxiesList.tsxportals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyOverview.tsxportals/ai-workspace/src/pages/appShell/appShellPages/serviceProvider/ProvidersList.tsxportals/ai-workspace/src/pages/appShell/appShellPages/serviceProvider/ServiceProviderOverview.tsxportals/ai-workspace/src/utils/artifactDeletion.tsportals/ai-workspace/src/utils/readOnlyArtifacts.tsx
This pull request enhances the deletion workflows for MCP Proxies, App LLM Proxies, and Service Providers by adding improved user feedback and safeguards, especially for read-only (gateway-managed) artifacts. It introduces consistent warning dialogs, disables deletion when blocked by active deployments or permissions, and clarifies error handling. These changes improve both user experience and system safety.
Deletion Workflow Improvements:
GatewayArtifactDeleteWarningto deletion dialogs for MCP Proxies, App LLM Proxies, and Service Providers to clearly inform users when deleting read-only (gateway-managed) artifacts. [1] [2] [3] [4]DisabledActionTooltipand improved logic for checking deployment status. [1] [2]Read-Only Artifact and Deployment Blocking Logic:
User Experience and Error Handling:
Code Consistency and Maintenance: