You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Validation silently rewrites bad input (e.g. interval -500 runs at max speed) #39
SettingsManager.validate_all_settings() sanitizes before validating, and sanitize_input() clamps and defaults values. Invalid input gets silently rewritten into a different, valid value, so validation never sees the mistake.
Why it matters
Some of these rewrites are dangerous for a clicker:
Typed
Becomes
Effect
Interval -500 (ms)
0
Max-speed clicking with no error
Interval 1OO (letter O)
1000
Runs at a different speed than typed
X -1200 (monitor left of primary)
0
Clicks at the wrong place on the primary monitor
Interval 999999
60000
Silently clamped
The < 0 checks in validate_clicks, validate_minutes, validate_variation and validate_burst_settings are dead code, because values reach them already clamped to >= 0.
Evidence
autoclicker/core/settings_manager.py:241-282 — sanitize_input: max(0, min(int(float(value)), 10000)) for coords (:253), max(0, min(float(value), 60000)) for interval (:255), return self.DEFAULT_SETTINGS.get(key, 0) on parse failure (:246, :280).
validate_all_settings (:284+) runs sanitize_input on every key, then validates the sanitized dict.
Split parsing from validation: parse the raw string to a number, report a field error on parse failure or out-of-range (no clamping, no defaults), and only sanitize types (strip, int/float).
Keep defaulting only for missing keys from older settings files, not for user input.
Put the field name in errors and highlight the offending entry in the UI.
Done when
Negative, non-numeric, and out-of-range values for every numeric field produce a validation error naming the field.
Unit tests cover -500, abc, 1OO, and over-max values per field.
No path turns invalid user input into a faster click rate.
Activity