The author, working with the serverless driver for PostgreSQL, encountered a problem with WebSockets support in Node 18 and above using undici, which was causing queries with an ORDER BY clause to hang or fail. The issue was resolved by adding byteLength and byteOffset arguments to the new DataView() call in the undici code, which fixed a bug related to how buffers are handled in Node's Buffer class. This fix worked because the buffer allocated for a WebSocket frame is often stored in a global pool of small buffers, which can lead to issues with writing data to the wrong location if not done correctly. The author also discovered that using writeUInt16BE() instead of creating a DataView() was faster and more readable than the original approach used by undici.