Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(events): Use new event dispatcher API #77

Merged
merged 5 commits into from
Nov 27, 2024

Conversation

felipecsl
Copy link
Member

@felipecsl felipecsl commented Nov 26, 2024

Towards: FF-3608
Towards: FF-3609

Motivation and Context

Hook into Eppo-exp/js-sdk-common#139 to use new event dispatcher API

See also Eppo-exp/js-client-sdk#103

Description

Integrate new event tracking API

How has this been tested?

Wrote tests

const eventQueue = new FileBackedNamedEventQueue('events');
const emptyNetworkStatusListener =
// eslint-disable-next-line @typescript-eslint/no-empty-function
{ isOffline: () => false, onNetworkStatusChange: () => {} };
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i opted to not provide an implementation for NetworkStatusListener since I didn't think it made sense for node server side. We could expose an optional property in IClientConfig though, to allow users to provide their own implementation. thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me to leave it out for now

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the server is offline, then nothing else will work, so it feels like pointless to handle that, except in the client side

@felipecsl
Copy link
Member Author

felipecsl commented Nov 26, 2024

I'm getting a lot of test failures that don't look related to my change 👀 fixed

@felipecsl felipecsl merged commit ea45a88 into main Nov 27, 2024
8 checks passed
@felipecsl felipecsl deleted the felipecsl--event-dispatcher branch November 27, 2024 17:11
const emptyNetworkStatusListener =
// eslint-disable-next-line @typescript-eslint/no-empty-function
{ isOffline: () => false, onNetworkStatusChange: () => {} };
return newDefaultEventDispatcher(eventQueue, emptyNetworkStatusListener, sdkKey);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance it would help to wrap this with a try-catch as proposed here Eppo-exp/js-client-sdk#104

This also throws an exception, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct

maya-the-mango pushed a commit that referenced this pull request Nov 29, 2024
* feat(events): Use new event dispatcher API

* add tests for splice

* fix tests

* fix tests

* Add test matrix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants