ironSource / parquetjs

fully asynchronous, pure JavaScript implementation of the Parquet file format
MIT License
349 stars 174 forks source link

Fix ParquetTransformer final multiple callback #135

Open jeffbski-rga opened 2 years ago

jeffbski-rga commented 2 years ago

ParquetTransformer _flush method calls the callback directly by passing it in as a parameter and then again calls it as the result to a promise. In earlier versions of Node.js this didn't appear to cause a problem even though technically it was wrong, but Node.js v16 now catches this problem and throws an ERR_MULTIPLE_CALLBACK. The solution is to simply not pass the callback in and only handle it from the promise (on resolve and reject).