Skip to content

[Bug]: HTTP API Dataset Deletion Stops at First Invalid ID in List, Leaving Subsequent Datasets Undeleted #5760

Closed
@asiroliu

Description

@asiroliu

Is there an existing issue for the same bug?

  • I have checked the existing issues.

RAGFlow workspace code commit ID

x

RAGFlow image version

26349569e613 (infiniflow/ragflow:nightly-slim )

Other environment information

Actual behavior

The deletion API exhibits inconsistent behavior depending on the position of invalid IDs in the request payload. When invalid IDs are appended, valid IDs are deleted; when invalid IDs are prepended, no deletion occurs. This violates atomicity expectations and risks unintended data loss or retention.

Expected behavior

No response

Steps to reproduce

1. Create a dataset and record its ID:  

ids = create_datasets(get_http_api_auth, 1)  

2. Send a deletion request with an ​invalid dataset ID appended to the valid IDs

res = delete_dataset(get_http_api_auth, {"ids": ids + ["invalid_id"]})  

Response:

{'code': 102, 'message': "You don't own the dataset invalid_id"} 

​Observed Behavior:
Listing datasets shows the original dataset was deleted:

{'code': 0, 'data': []}  

3. Send a deletion request with the ​invalid ID placed before valid IDs:

res = delete_dataset(get_http_api_auth, {"ids": ["invalid_id"] + ids})  

Response:

{'code': 102, 'message': "You don't own the dataset invalid_id"}  

​Observed Behavior:
Listing datasets shows the original dataset ​still exists:

{'code': 0, 'data': [  
  {  
    "avatar": null,  
    "chunk_count": 0,  
    "chunk_method": "naive",  
    // ...other fields
  }]
}

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions