LDClient.flush() does not reject if there is an error sending analytics #777
Labels
bug
Something isn't working
package: shared/sdk-server
Label for issues affecting the shared/sdk-server package.
Describe the bug
LDClient.flush()
does not reject like it states if the underlyingEventProcessor.flush()
call throws, irrespective of callback.if a callback is provided, the callback will receive the error, the promise will not reject as intended. If no callback is provided, the promise will still not reject, which is unintended as per the JSDoc.
To reproduce
await LDClient.flush()
with an expliciteventsUri
that has an error status code, like 503.await LDClient.flush((error, success) => console.error(success, error));
, you will get a console error output.Expected behavior
The promise on
await LDClient.flush()
should reject if there is an error.Logs
If applicable, add any log output related to your problem.
SDK version
Language version, developer tools
OS/platform
Solution
Added some comments to explain what the solution I think could be, also found that the
callback
is called with an error and then immediately again without one, so that should also be fixed.The text was updated successfully, but these errors were encountered: