Make document change-status idempotent for Infinity doc store (#12717)

### What problem does this PR solve?

This PR makes the document change‑status endpoint idempotent under the
Infinity doc store. If a document already has the requested status, the
handler returns success without touching the engine, preventing
unnecessary updates and avoiding missing‑table errors while keeping
responses consistent.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
6ba3i
2026-01-20 19:11:21 +08:00
committed by GitHub
parent 9ebbc5a74d
commit aee9860970
8 changed files with 55 additions and 14 deletions

View File

@ -53,7 +53,7 @@ class TestRquest:
BAD_CONTENT_TYPE = "text/xml"
res = create_dataset(HttpApiAuth, {"name": "bad_content_type"}, headers={"Content-Type": BAD_CONTENT_TYPE})
assert res["code"] == 101, res
assert res["message"] == f"Unsupported content type: Expected application/json, got {BAD_CONTENT_TYPE}", res
assert "Field: <name>" in res["message"], res
@pytest.mark.p3
@pytest.mark.parametrize(

View File

@ -51,7 +51,7 @@ class TestRquest:
BAD_CONTENT_TYPE = "text/xml"
res = delete_datasets(HttpApiAuth, headers={"Content-Type": BAD_CONTENT_TYPE})
assert res["code"] == 101, res
assert res["message"] == f"Unsupported content type: Expected application/json, got {BAD_CONTENT_TYPE}", res
assert "Field: <ids>" in res["message"], res
@pytest.mark.p3
@pytest.mark.parametrize(

View File

@ -56,7 +56,7 @@ class TestRquest:
BAD_CONTENT_TYPE = "text/xml"
res = update_dataset(HttpApiAuth, dataset_id, {"name": "bad_content_type"}, headers={"Content-Type": BAD_CONTENT_TYPE})
assert res["code"] == 101, res
assert res["message"] == f"Unsupported content type: Expected application/json, got {BAD_CONTENT_TYPE}", res
assert res["message"] == "No properties were modified", res
@pytest.mark.p3
@pytest.mark.parametrize(