Repository navigation
[web] Fix potential race condition in ClickDebouncer - #173294
Conversation
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.
| /// | ||
| /// 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 |
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.
Based on Gemini's comment: flutter#173072 (comment)
Based on Gemini's comment: flutter#173072 (comment)
Based on Gemini's comment: flutter#173072 (comment)
Based on Gemini's comment: flutter#173072 (comment)
Based on Gemini's comment: flutter#173072 (comment)
Based on Gemini's comment: #173072 (comment)