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

Unhandled promise rejection when flushing events #85

Description

@jbunton-atlassian

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 :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions