Storyboard-fm/little-media-box

Properly-formed `AudioTrack` instance fails `instanceof` check on serverless function

agrathwohl opened this issue · 0 comments

Recent work by @r-token on the walkie-talkie service has revealed a potential bug in AudioTrack, where the following instanceof operation unexpectedly fails:

const src = new Source(uri)
const at = AudioTrack.from(src)
at.ready(() => console.log(at instanceof AudioTrack))

The root cause is not presently known, as the unexpected behavior has only been found to be present in the development environment for the walkie-talkie Serverless service. Running the same code that fails on Serverless, on a local node repl directly, yields the expected true result and therefore cannot reproduce the issue.

There may be a need to dig into the way AudioTrack (and, potentially other classes) is constructed and what properties about it might cause the instanceof check to fail. There may also need to be an investigation into what aspects to lambda functions may result in this sort of behavior. We should reimplement any such discoveries to more appropriately match lambda's constraints, as this library will be expected to be used effectively within these environments.