馃悰 Bug Fixes
Critical Fix: API Response Handling
Fixed critical error that was causing "Cannot read properties of undefined (reading 'length')" when reading test cases and other API responses.
Changes
- Fixed content-length header validation - Removed incorrect check that returned undefined when header was null
- Added null/undefined checks in all API methods that return arrays (getCases, getLabels, getPlans, getMilestones, getProjects, getPriorities, getStatuses, getTemplates, getReports, etc.)
- Improved error handling in getCase to properly validate and handle empty responses
- Enhanced case-tools validation to check for undefined responses before processing
Impact
This fix resolves issues when:
- Reading test cases via
testrail_get_case - Listing test cases with
testrail_get_cases - Fetching labels, plans, milestones, and other resources
- Any operation that returns collections from TestRail API
Files Changed
42 files modified (source and compiled dist files)
- 200 additions
- 48 deletions
Testing
Confirmed working with production TestRail instance reading test case C400231.