Repository navigation
Conversation
The stepper called onEvent(), which cleared pendingEvent while a debounce timer was still live. That timer could no longer be cancelled, and each orphan that fired cleared pendingEvent again, so a late timer could write an old value back over what the user had typed. Fix found by Brandon Schabell in #4041. Co-authored-by: Brandon Schabell <brandonschabell@gmail.com>
|
Contributor
Dash performance benchmarks✅ all within thresholds
growth = late-third / early-third per-op time; ~1 is flat, a large value means the per-op cost scales with accumulated state. machine scale vs baseline: 0.77x - divided out of the baseline ratios so they compare like for like (the absolute warn/fail ceilings are left un-scaled); calibrated on |
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.



Salvages the
Input.tsxfix from #4041 by @brandonschabell. The rest of that PR (flaky test changes) was superseded by #4161 and #4188.Bug
With
dcc.Input(type="number", debounce=<seconds>), clicking a stepper button calledonEvent(), which clearspendingEventwhile the debounce timer started by the value effect is still running. That timer can no longer be cancelled. When it fires, its ownonEvent()clearspendingEventagain and orphans the next timer. Eventually a stale timer skipssetProps(itsprops.valuebase is stale) and clearspendingEvent, and theprops.valueeffect writes an old value over what the user typed.Example: click a stepper twice, then type and edit within the debounce window. A digit you deleted comes back.
Fix
The stepper calls
setPropValuedirectly, so it pushes the value without touchingpendingEvent.Test
test_inni012_stepper_does_not_orphan_debouncelines up clicks and keystrokes so timers overlap. It fails ondev(output10274instead of1027) and passes with the fix. Thetest_inni012from #4041 passed on both, since clicks alone keep props and the DOM in sync and can't trigger the revert.