Fix missing workflow 404 handling and add regression tests#326
Merged
pradeeban merged 2 commits intoControlCore-Project:devfrom Feb 20, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #323
Problem
GET /workflow/<serverID>could miss the intended404 Not Foundpath because model and controller used different not-found contracts:WorkFlowModel.get()could return(False, 'Record Not Found')getWorkflow()checked only forNoneThis mismatch could lead to invalid downstream behavior instead of a clean 404.
Root Cause
Inconsistent API contract between:
server/model/workflows.pyserver/controller/workflow.pyChanges
WorkFlowModel.get()now returnsNonewhenserverIDis missing.isMissingWorkflow(...)guard inserver/controller/workflow.py.None(False, 'Record Not Found')GET /workflow/<serverID>consistently returns404for missing workflows.server/tests/test_workflow_controller.pyNone) ->404404X-Latest-Hash->400X-Latest-Hash->200Files Changed
server/model/workflows.pyserver/controller/workflow.pyserver/tests/test_workflow_controller.pyBehavior After This PR
GET /workflow/<missing-id>always returns404 Not FoundX-Latest-HashValidation
python -m py_compile server/controller/workflow.py server/model/workflows.py server/tests/test_workflow_controller.pyserver/):python -m unittest discover -s tests -p "test_*.py" -vRan 4 tests ... OKTest Output Screenshot
Notes
This is backward-compatible at controller level while moving model behavior to a single clear not-found contract.