Fix SearchAnchor triggers unnecessary suggestions builder calls#143443
Fix SearchAnchor triggers unnecessary suggestions builder calls#143443auto-submit[bot] merged 1 commit intoflutter:masterfrom TahaTesser:fix_suggestionsBuilder_bug
SearchAnchor triggers unnecessary suggestions builder calls#143443Conversation
|
cc: @sun-jiao |
|
cc: @QuncCccccc |
QuncCccccc
left a comment
There was a problem hiding this comment.
Thanks for the fix! LGTM! Sorry for the late response.
|
It seems the |
Thanks! I'll take a closer look in the morning |
|
There was a problem hiding this comment.
IMO this should use a Timer. And the pending timer should be disposed if State.dispose is called while the timer is open
There was a problem hiding this comment.
unawaited was there so i can try work around it.
I applied your suggestion to use Timer and it does pass flutter_hooks test locally.
Can you please explain why Timer is better? unawaited is fairly new.
There was a problem hiding this comment.
Future internally creates a Timer. But that Timer is not disposed until the callback executes.
So this creates a race condition between the test assertion about "non-disposed Timers" and the callback execution.
If the Timer assert runs before the callback is executed, Future's Timer has yet to be cleaned-up, making the Timer assert fail.
There was a problem hiding this comment.
I appreciate your suggestion and explanation, it helped a lot.
|
With Remi's suggestion, all tests are green now. |
QuncCccccc
left a comment
There was a problem hiding this comment.
LGTM:) Thanks for the fix!
fixes
SearchAnchortriggers extra search operationsCode sample
expand to view the code sample
Before
before.mp4
After
after.mp4
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.