[bug]: Can't delete custom project states
Is there an existing issue for this?
- [x] I have searched the existing issues
Current behavior
When I delete a workflow state from a project in a workspace, it disappears from the list, but when I refresh the page, the deleted state reappears.
What should happen is the workflow state gets deleted and does not reappear on subsequent page refreshes.
I believe the state is merely getting removed from the web UI when deleted, but is not actually getting deleted on the backend.
Steps to reproduce
Plane Community Edition v1.2.0 deployed using Helm chart v1.4.1
- Go to a project where the current user is an admin.
- Open project settings > states.
- Create a new state in any category.
- Delete the state (state will disappear from web UI)
DevTools Network Tab: DELETE <instance_url>/api/workspaces/<my_workspace>/projects/e2264f72-c655-496c-8305-90ed3a259943/states/3a2cbc28-f3c5-4d30-8c4c-c1e0d1fb5f01/
Project ID and State ID in API request are correct.
Returns HTTP 204 with no response content.
- Refresh the page (state will reappear and was not deleted)
Makes an API request to /api/workspaces/<my_workspace>/projects/e2264f72-c655-496c-8305-90ed3a259943/states/
Response object includes all project states, including the states that were supposed to be deleted.
Environment
Production
Browser
Mozilla Firefox
Variant
Self-hosted
Version
v1.2.0
๐ CodeRabbit Plan Mode
Generate an implementation plan and prompts that you can use with your favorite coding agent.
- [ ] Create Plan
๐ Similar Issues
Related Issues
- https://github.com/makeplane/plane/issues/7043
- https://github.com/makeplane/plane/issues/6894
- https://github.com/makeplane/plane/issues/5768
- https://github.com/makeplane/plane/issues/6929
- https://github.com/makeplane/plane/issues/6718
๐ค Suggested Assignees
๐งช Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
๐ฌ Have feedback or questions? Drop into our discord or schedule a call!
Root Cause Analysis (by Claude Code)
I investigated the PostgreSQL database directly and found that:
-
The DELETE endpoint IS working correctly - it's performing a soft delete by setting the
deleted_attimestamp on the state record. -
The bug is in the GET endpoint - The
GET /api/workspaces/<workspace>/projects/<project_id>/states/endpoint is returning ALL states, including soft-deleted ones, instead of filtering them out.
Database Evidence
The states table schema includes a deleted_at column for soft deletion:
deleted_atisNULLfor active statesdeleted_atcontains a timestamp for deleted states
When I deleted states via the UI:
- The DELETE API correctly set
deleted_atto a timestamp (e.g.,2025-12-23 23:02:08.916523+00) - However, subsequent GET requests still returned these soft-deleted states in the response
Expected Fix
The states list endpoint should filter the queryset to exclude soft-deleted records:
# Current (incorrect) behavior - returns all states
states = State.objects.filter(project_id=project_id)
# Expected behavior - should exclude soft-deleted states
states = State.objects.filter(project_id=project_id, deleted_at__isnull=True)
Workaround
Until this is fixed, deleted states can be permanently removed with:
DELETE FROM states WHERE deleted_at IS NOT NULL;