Closed andreainnocenti closed 6 months ago
I was able to reproduce the bug also in your unit test.
I only removed this line https://github.com/elastic/elastic-transport-js/blob/main/test/unit/undici-connection.test.ts#L27C1-L27C7.
The package node-abort-controller
should not be used in Node.js version >= 16 as described in https://www.npmjs.com/package/node-abort-controller#nodejs-library-only-supports-node-16-or-above.
If you use the native AbortController definition, the app crashes.
Good catch @andreainnocenti. I'll pick this up and get it fixed soon.
Hi @JoshMock, any update on this bug?
I got sidetracked! I'm planning to publish some upgrades in the next few days so I'll try to fit this in.
Got a fix for this in https://github.com/elastic/elastic-transport-js/pull/78. I have another PR pending before I planned to push a new version to npm, but if that gets delayed I will try to remember to push a patch version in the next few days.
It's not uncommon that somebody already opened an issue or in the best case it's already fixed but not merged. That's the reason why you should search at first before submitting a new one.
Please read this entire template before posting any issue. If you ignore these instructions and post an issue here that does not follow the instructions, your issue might be closed, locked, and assigned the
not reproducible
label.🐛 Bug Report
According to https://nodejs.org/api/events.html#eventtargetdispatcheventevent, the
dispatchEvent
function must take in input an Event object but in https://github.com/elastic/elastic-transport-js/blob/v8.3.4/src/connection/UndiciConnection.ts#L144, the input is a string.Currently our microservice crashes if the search reaches the timeout:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Do not crash in case of timeouts.
Your Environment
@elastic/elasticsearch
version: >=8.7.0