Fix a multiple pointers bug#68587
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
Thank you so much for the investigation and the writeup! Can you come up with a unit test so that we don't accidentally regress it? |
Coming soon. |
Done. |
| @mustCallSuper | ||
| void resolvePointer(int pointer, GestureDisposition disposition) { | ||
| final GestureArenaEntry? entry = _entries[pointer]; | ||
| final Map<int, GestureArenaEntry> localEntries = Map<int, GestureArenaEntry>.from(_entries); |
There was a problem hiding this comment.
Why is this clone needed?
There was a problem hiding this comment.
entry. resolve() will trigger nested
calls to this function, so we should remove the entry first as following do.
There was a problem hiding this comment.
The entry in the map is a reference type here, I think we can use it after removing it from the map without clone, I will double check:)
There was a problem hiding this comment.
I have removed the unnecessary map clone.
|
@dkwingsmt I think it is ready for landing now. : ) |
This reverts commit bde85ea.
|
你好 这边已经是最新版本 master 分支 |
抱歉这个修正昨天被回退了#68841 ,请确认你验证的版本,如果包含了这个修正还是有问题,请帮忙提供版本信息,和一个最小范围内可以直接运行的复现问题的用例,谢谢。 我会尽快调查影响然后重新合入这个修正。 Sorry, this fix was revert yesterday #68841 . Please confirm the version you verified. If there is still a problem with the change, please provide the version information and a minimal sample code that can be run directly. Thank you. I'll look into the impact as soon as possible and then reland this PR. |
|
@dkwingsmt |
Description
This bug can be reproduced with a high probability by #68373
The scenario where the bug occurs is:
TapGestureRecognizer&VerticalDragGestureRecognizer#5efda)TapGestureRecognizer&VerticalDragGestureRecognizer#5efda)TapGestureRecognizer&VerticalDragGestureRecognizer#5efda)VerticalDragGestureRecognizer#5efda)Because there is only one gesture in Arena 4, the
VerticalDragGestureRecognizer#5efdawill win by default, andacceptGesture. Therefore, this gesture can no longer be accepted by another arena, otherwise, there will be the assertion information mentioned in the #68373.Why the issue happen?
From the log we can catch that:
_TransformedPointerCancelEvent,What we expect isstopTrackingPointerand then reject this gesture, as the following code show:didStopTrackingLastPointerand clear the_velocityTrackers, This leads to theresolvePointermethod cannot be called. This gesture becomes the last member and wins via sweeping incorrectly.Related PR
This change is an improvement of #39017, @dkwingsmt Please review, thanks. :)
Log
Related Issues
Fixes #68373
Tests
See files.