You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was unsure whether this should be an issue with this module or async-listener, but I found an obscure bug in my code that only happened when one of my dependencies was loading async-listener (I think it was aws-xray-sdk-core).
Unfortunately the way shimmer monkey-patches fs.read means that it does not preserve customPromisifyArgs, which means that using util.promisify(fs.read)(...) returns simply the number bytesRead instead of the object { bytesRead, buffer } like it is meant to.
This can be quite tricky to find because it invalidates so many assumptions - I wasn't even aware that I had a dependency of a dependency of a dependency that was duck punching the fs module, so it took me much longer than I would like to admit to find that async-listener was the cause of my problems.
The text was updated successfully, but these errors were encountered:
@othiym23 Is there a particular reason why shimmer does not copy properties and symbols from the original function? I'm willing to send a PR since we need this as well, but it's unclear if the omission was on purpose.
I was unsure whether this should be an issue with this module or
async-listener
, but I found an obscure bug in my code that only happened when one of my dependencies was loadingasync-listener
(I think it was aws-xray-sdk-core).Unfortunately the way
shimmer
monkey-patchesfs.read
means that it does not preservecustomPromisifyArgs
, which means that usingutil.promisify(fs.read)(...)
returns simply the numberbytesRead
instead of the object{ bytesRead, buffer }
like it is meant to.This can be quite tricky to find because it invalidates so many assumptions - I wasn't even aware that I had a dependency of a dependency of a dependency that was duck punching the
fs
module, so it took me much longer than I would like to admit to find thatasync-listener
was the cause of my problems.The text was updated successfully, but these errors were encountered: