649ebf2dc7dc9c4b6f348c61c89b9e9c572a73c9
TASK-BUG-04: The autoSavePayload was using the || operator to fall back to server values when ban_time, find_time, or max_retry were empty or zero. This silently dropped user intent to set these fields to 0, which is a valid and meaningful value in fail2ban (e.g., ban_time=0 means permanent ban). Replace the || fallback with explicit NaN and empty-string guards that only fall back when: 1. The trimmed input is empty (user cleared the field) 2. The input is non-numeric (NaN) This preserves valid zero values while still falling back appropriately for invalid input. - ban_time: 0 now correctly sends permanent ban instead of falling back - find_time: 0 now sends the intended value instead of falling back - max_retry: 0 now sends the intended value instead of falling back Added comprehensive tests for: - Preserving zero values in the payload - Falling back for empty input - Falling back for non-numeric input Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Description
No description provided
Languages
Python
61.2%
TypeScript
24.9%
HTML
8.4%
Markdown
2.5%
Roff
0.9%
Other
2%