This repository was archived by the owner on May 30, 2024. It is now read-only.

Description
client.flush returns a promise but nothing is attached to handle rejections. This is deprecated in Node and in the future will cause the process to exit in a similar manner to an unhandled exception.
In our production services we have already configured unhandled rejections to cause a process exit. I noticed this bug because timeouts in the LaunchDarkly client are causing our processes to die when there is a network timeout.
I've created a demo repo if you want to try this out:
https://github.com/jbunton-atlassian/launchdarkly-bug-promise-rejection
It hardcodes a black hole IP address to simulate a timeout. Run it with the SDK_KEY and FEATURE_KEY environment variables. After a few seconds the automatic flush will trigger and you'll see the promise rejection warning.
Thanks :)