tatut / clj-chrome-devtools

Clojure API for controlling a Chrome DevTools remote
MIT License
130 stars 21 forks source link

Add timeout to automation/evaluate #17

Closed aviflax closed 5 years ago

aviflax commented 5 years ago

I maintain a tool that uses this library and I recently had to debug an issue wherein the tool would hang in certain circumstances. It turned out that I was executing a JS expression that was returning too much data — I didn’t know about the default 1MB limit and it took me a good while to figure out what was happening. I’ll be contributing a different PR to add some logging to hopefully help other people who run into similar problems, but this PR is focused on adding a timeout to automation/evaluate. I did this first in the tool’s code because (a) it helped me debug the underlying problem by giving my REPL back to me instead of hanging indefinitely and (b) it just seemed like a better failure mode than hanging.

Given that this seems like a better way for evaluate to work, I thought I’d offer it as an enhancement to the library.

tatut commented 5 years ago

Nice. Thanks.

aviflax commented 5 years ago

My pleasure!