[web] Fix potential race condition in ClickDebouncer#173294
Merged
auto-submit[bot] merged 2 commits intoflutter:masterfrom Aug 5, 2025
Merged
[web] Fix potential race condition in ClickDebouncer#173294auto-submit[bot] merged 2 commits intoflutter:masterfrom
auto-submit[bot] merged 2 commits intoflutter:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request addresses a potential race condition in the ClickDebouncer. The fix is straightforward and correct: it adds a check to ensure that debouncing has not been cancelled before proceeding with setting the debouncer state. The newly added test case is comprehensive and accurately simulates the race condition, confirming the effectiveness of the fix. The changes are well-implemented and improve the robustness of the pointer event handling.
5 tasks
justinmc
approved these changes
Aug 5, 2025
| /// | ||
| /// This method is called asynchronously from [_maybeStartDebouncing]. | ||
| void _doStartDebouncing(DomEvent event, List<ui.PointerData> data) { | ||
| // It's possible that debouncing was cancelled between the pointerdown event and the execution |
Contributor
There was a problem hiding this comment.
Super nit: "canceled" with one "l" is the American spellling, see https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md#spell-words-in-identifiers-and-comments-correctly.
danilozhang
pushed a commit
to danilozhang/flutter
that referenced
this pull request
Aug 6, 2025
Based on Gemini's comment: flutter#173072 (comment)
ksokolovskyi
pushed a commit
to ksokolovskyi/flutter
that referenced
this pull request
Aug 19, 2025
Based on Gemini's comment: flutter#173072 (comment)
mboetger
pushed a commit
to mboetger/flutter
that referenced
this pull request
Sep 18, 2025
Based on Gemini's comment: flutter#173072 (comment)
korca0220
pushed a commit
to korca0220/flutter
that referenced
this pull request
Sep 22, 2025
Based on Gemini's comment: flutter#173072 (comment)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 12, 2025
lucaantonelli
pushed a commit
to lucaantonelli/flutter
that referenced
this pull request
Nov 21, 2025
Based on Gemini's comment: flutter#173072 (comment)
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.
Based on Gemini's comment: #173072 (comment)