From 6e7bcb599ad913ce26e50778c5e401ff0682b5d2 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Mon, 6 Apr 2026 20:42:26 +0200 Subject: [PATCH] once invalid value causes other to fail too --- facefusion/apis/endpoints/state.py | 5 ++++- tests/test_api_state.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/facefusion/apis/endpoints/state.py b/facefusion/apis/endpoints/state.py index 322b16b6..ba121c3c 100644 --- a/facefusion/apis/endpoints/state.py +++ b/facefusion/apis/endpoints/state.py @@ -34,9 +34,12 @@ async def set_state(request : Request) -> JSONResponse: 'message': translator.get('invalid_state_key', 'facefusion.apis') }, status_code = HTTP_400_BAD_REQUEST) __api_args__[key] = value - state_manager.set_item(key, value) if __api_args__: + + for key, value in __api_args__.items(): + state_manager.set_item(key, value) + __api_args__ = args_helper.extract_api_args(state_manager.get_state()) return JSONResponse(state_manager.collect_state(__api_args__), status_code = HTTP_200_OK) diff --git a/tests/test_api_state.py b/tests/test_api_state.py index 4210ba1e..5d150590 100644 --- a/tests/test_api_state.py +++ b/tests/test_api_state.py @@ -132,6 +132,7 @@ def test_set_state(test_client : TestClient) -> None: }) set_state_body = set_state_response.json() + assert set_state_body.get('execution_providers') is None assert set_state_body.get('invalid') is None assert set_state_response.status_code == 400