question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible race condition when simulating double click - dedicated API method needed

See original GitHub issue

It seems currently the only way to simulate double click is to call `mouse.down()/up/down/up".

Every call will wait until previous one completes. And if the remote method call is performed using the network (like websocket) there’s a possibility of arbitrary delay between the calls.

If such delay will exceed the double click threshold - browser won’t fire the “dblclick” event, only 2 regular clicks.

This is a potential race condition.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
JoelEinbindercommented, Dec 28, 2017

Yep! dblclick is fired by clickCount, not by the timeout. That way we can send clicks as fast as possible without triggering double click, or send double clicks with arbitrary delay in between each click.

 const button = await page.$('button');
 await button.click();
 await new Promise(x => setTimeout(x, 1000));
 await button.click({ clickCount: 2 });
0reactions
Karim10kcommented, Apr 19, 2021

is there another solution for this , I tried all the suggestions nothing works

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is a Race Condition? - TechTarget
This kind of race condition happens when two processes read a value in a program and write back a new value. It often...
Read more >
Race-free way to asynchronously start AND cancel I/O on ...
Background: generally, if we want to force an operation to happen asynchronously (to avoid blocking the main thread), using FILE_FLAG_OVERLAPPED ...
Read more >
Towards Systematic Black-Box Testing for Exploitable Race ...
this method contains a list of common race condition vulnerabilities in web apps and a detailed strategy of how to test for these...
Read more >
Fixing a Race Condition - Medium
They believed the race condition was caused by an interview update being handled by more than one process at the same time.
Read more >
Pushing the Limits of Parallel Discrete Event Simulation for ...
A dedicated SystemC compiler and corresponding parallel simulator ... identifies all potential race conditions, and then instruments the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found