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.
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.