Repository navigation
Conversation
An integer duration of 0 was treated as falsy by the or-chain in parse_swipe_parameters and silently replaced with the default (800ms), while the string "0" was honored as 0ms. Select the first key whose value is usable as a duration (present, not a bool, and convertible to int) so an explicit 0 is honored while empty or invalid values still fall through to the next key. This preserves both the duration > duration_ms > time_in_ms precedence and the previous fall-through for unusable values. Adds unit coverage for parse_swipe_parameters, which had none.
Atishyy27
force-pushed
the
fix-swipe-duration-zero
branch
from
September 14, 2026 09:04
07d968c to
98873fc
Compare
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.
parse_swipe_parameterspicked the duration with anor-chain, so an integer0was treated as falsy and replaced by the 800ms default, while the string"0"survived as 0ms. The same value behaved differently by type.The fix selects the first key whose value is usable as a duration (present, not a boolean, convertible to int). An explicit
0is honored, empty or invalid values still fall through to the next key, and theduration > duration_ms > time_in_msprecedence holds. Adds unit coverage forparse_swipe_parameters, which had none.I honored
0so the int and string paths agree. If you would rather rejectduration <= 0as invalid, happy to switch; either way it makes the two forms consistent.