second-state / wasmedge-quickjs

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

ServerResponse must have finished property #128

Open lastmjs opened 10 months ago

lastmjs commented 10 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.