{"detail":[{"type":"int_parsing","loc":["query","channel_idx"],"msg":"Input should be a valid integer, unable to parse string as an integer","input":""}]}
when you push the filter button...
{"detail":[{"type":"int_parsing","loc":["query","channel_idx"],"msg":"Input should be a valid integer, unable to parse string as an integer","input":""}]}
<!-- github-sync-id:3701996600 -->
Issue: The filter button on the messages screen was causing a parse error when "All Channels" was selected.
Error: channel_idx query parameter was receiving an empty string when FastAPI expected an integer or None.
Root Cause
The HTML form sends channel_idx="" when "All Channels" is selected, but FastAPI's query parameter validation requires either a valid integer or the parameter to be omitted entirely. Empty strings cannot be parsed as integers, causing the validation error.
Solution
Modified src/meshcore_hub/web/routes/messages.py:
Changed channel_idx parameter type from int | None to str | None
Added parsing logic to convert valid integers and treat empty strings as None
Added error handling with logging for invalid values
Only passes valid integers to the API, preventing parse errors
Changes Summary
✅ Filter button now works correctly with "All Channels" selection
✅ Valid channel numbers (0-7) still work as expected
✅ Invalid values are logged and ignored gracefully
✅ No changes needed to API or template files
Next Steps
--- |
**Claude finished @jinglemansweep's task** —— [View job](https://github.com/ipnet-mesh/meshcore-hub/actions/runs/19991388947) • [`claude/issue-25-20251206-1646`](https://github.com/ipnet-mesh/meshcore-hub/tree/claude/issue-25-20251206-1646) • [Create PR ➔](https://github.com/ipnet-mesh/meshcore-hub/compare/main...claude/issue-25-20251206-1646?quick_pull=1&title=fix%3A%20Handle%20empty%20channel_idx%20parameter%20in%20messages%20filter&body=Fixed%20parse%20error%20when%20clicking%20the%20filter%20button%20on%20messages%20screen%20with%20%22All%20Channels%22%20selected.%0A%0AThe%20form%20was%20sending%20an%20empty%20string%20for%20channel_idx%2C%20but%20FastAPI%20expected%20either%20a%20valid%20integer%20or%20None.%0A%0A%23%23%20Changes%0A-%20Accept%20channel_idx%20as%20string%20in%20query%20parameter%0A-%20Parse%20and%20validate%20channel_idx%20before%20passing%20to%20API%0A-%20Treat%20empty%20strings%20as%20None%20to%20prevent%20validation%20errors%0A-%20Add%20error%20handling%20for%20invalid%20integer%20values%0A%0AFixes%20%2325%0A%0A---%0AGenerated%20with%20%5BClaude%20Code%5D%28https%3A%2F%2Fclaude.ai%2Fcode%29)
---
### Fixed: Filter Button Parse Error ✓
**Issue**: The filter button on the messages screen was causing a parse error when "All Channels" was selected.
**Error**: `channel_idx` query parameter was receiving an empty string when FastAPI expected an integer or None.
### Root Cause
The HTML form sends `channel_idx=""` when "All Channels" is selected, but FastAPI's query parameter validation requires either a valid integer or the parameter to be omitted entirely. Empty strings cannot be parsed as integers, causing the validation error.
### Solution
Modified `src/meshcore_hub/web/routes/messages.py`:
- Changed `channel_idx` parameter type from `int | None` to `str | None`
- Added parsing logic to convert valid integers and treat empty strings as `None`
- Added error handling with logging for invalid values
- Only passes valid integers to the API, preventing parse errors
### Changes Summary
- ✅ Filter button now works correctly with "All Channels" selection
- ✅ Valid channel numbers (0-7) still work as expected
- ✅ Invalid values are logged and ignored gracefully
- ✅ No changes needed to API or template files
### Next Steps
--- |
<!-- github-comment-id:3620682470 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
when you push the filter button...
{"detail":[{"type":"int_parsing","loc":["query","channel_idx"],"msg":"Input should be a valid integer, unable to parse string as an integer","input":""}]}
@claude Can you investigate
Claude finished @jinglemansweep's task —— View job •
claude/issue-25-20251206-1646• Create PR ➔Fixed: Filter Button Parse Error ✓
Issue: The filter button on the messages screen was causing a parse error when "All Channels" was selected.
Error:
channel_idxquery parameter was receiving an empty string when FastAPI expected an integer or None.Root Cause
The HTML form sends
channel_idx=""when "All Channels" is selected, but FastAPI's query parameter validation requires either a valid integer or the parameter to be omitted entirely. Empty strings cannot be parsed as integers, causing the validation error.Solution
Modified
src/meshcore_hub/web/routes/messages.py:channel_idxparameter type fromint | Nonetostr | NoneNoneChanges Summary
Next Steps
--- |
Tested, confirmed working.