Skip to content

[bug]: Soft-deleted States still visible after page refresh #8590

@tharayuth

Description

@tharayuth

Description

When deleting a State in Project Settings → States, the state disappears immediately from the UI. However, after refreshing the page (F5), the deleted state reappears and is visible again.

Environment

  • Plane Version: v1.2.1 (stable)
  • Deployment Method: Docker Compose (Self-hosted)
  • Image Source: artifacts.plane.so/makeplane
  • OS: Linux (Ubuntu/Debian)
  • Browser: Chrome 144.0.0.0

Steps to Reproduce

  1. Create a new project or use an existing project
  2. Go to Project SettingsStates
  3. Create a new state (e.g., "Test State")
  4. Click the delete button (trash icon) on the newly created state
  5. Observe: The state disappears from the list ✓
  6. Refresh the page (F5)
  7. Observe: The deleted state reappears in the list ✗

Expected Behavior

After deleting a state and refreshing the page, the deleted state should remain deleted and not be visible.

Actual Behavior

The deleted state reappears after page refresh, even though:

  • The DELETE API call returns HTTP 204 (success)
  • The deleted_at timestamp is correctly set in the database

Root Cause Analysis

I investigated the database and found that Plane uses soft delete (sets deleted_at timestamp instead of removing the record):

SELECT id, name, deleted_at FROM states WHERE project_id = '<PROJECT_ID>';

Result:

name deleted_at
Backlog NULL
Todo NULL
Test State 2026-01-27 08:34:00+00

The API GET endpoint /api/workspaces/{workspace}/projects/{project}/states/ appears to not filter out records where deleted_at IS NOT NULL, causing soft-deleted states to be returned and displayed.

API Logs Evidence

# Delete request - returns 204 (success)
DELETE /api/workspaces/.../states/a8b281e4-.../ 204

# Subsequent GET request still returns the deleted state
GET /api/workspaces/.../states/ 200

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions