second-state / wasmedge-quickjs

A high-performance, secure, extensible, and OCI-complaint JavaScript runtime for WasmEdge.
Apache License 2.0
477 stars 59 forks source link

ServerResponse must have finished property #128

Open lastmjs opened 7 months ago

lastmjs commented 7 months ago

This bug was absolutely crazy to track down. Essentially ServerResponse should have the finished = false; set at least on instantiation. When trying to get an Express.js application to work, some of the streaming code looks for that finished property. If it is not there, then it thinks that the read stream is instantly finished and sets a macro task for execution. This terminates the read stream right away and breaks the functionality. Simply adding that property to ServerResponse fixes the issue for me.

We should probably ensure that these Node data structures have all original properties at least initialized, even if they are not used.