diff --git a/app/utils/file_status.py b/app/utils/file_status.py index ab39c21d..75c84526 100644 --- a/app/utils/file_status.py +++ b/app/utils/file_status.py @@ -160,7 +160,7 @@ def get_files_processing_status(db: Session, file_ids: List[int]) -> Dict[int, D status = "completed" else: status = "pending" - elif terminal_step is not None and terminal_step.status in ("success", "skipped"): + elif terminal_step is not None and terminal_step.status == "success": # Terminal step succeeded but some intermediate steps are # still "pending" (dynamic pipeline artifacts). The file # is effectively complete. diff --git a/app/utils/step_manager.py b/app/utils/step_manager.py index e663d18e..9e4449a3 100644 --- a/app/utils/step_manager.py +++ b/app/utils/step_manager.py @@ -271,7 +271,7 @@ def get_file_overall_status(db: Session, file_id: int) -> Dict: status = "completed" else: status = "pending" - elif terminal_step_obj is not None and terminal_step_obj.status in ("success", "skipped"): + elif terminal_step_obj is not None and terminal_step_obj.status == "success": # The terminal step succeeded but some intermediate steps are still # "pending" (e.g. check_for_duplicates logged without file_id, or # extract_text not marked when OCR path was taken). The pipeline diff --git a/tests/test_step_manager.py b/tests/test_step_manager.py index 3611a990..2c3cdb47 100644 --- a/tests/test_step_manager.py +++ b/tests/test_step_manager.py @@ -339,6 +339,8 @@ class TestStepManager: # Terminal step hasn't run yet, so file should remain pending assert status["status"] == "pending" + assert status["has_errors"] is False + assert status["completed_steps"] == 3 def test_get_file_overall_status_failed(self, db_session: Session): """Test overall status for a file with failed steps."""