-
Notifications
You must be signed in to change notification settings - Fork 12
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
[Player] Use event producer #92
base: add-event-sender
Are you sure you want to change the base?
Conversation
@@ -1,2 +1,38 @@ | |||
export "$(grep -vE "^(#.*|\s*)$" .env)" | |||
TEST_USER=$TEST_USER npm run wtr $1 | |||
# TEST_USER=$TEST_USER npm run wtr $1 | |||
# Event Producer seems to prevent WTR from running all tests in one go, so we need to run them one by one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Web Test Runner wouldn't run normally but running each test individually worked, so I succumbed to this hack.
I believe Event Producer is the culprit, doesn't seem it's made for testing in mind. After my first attempts of running the tests I got its IDB filled with 300 000 items and Chrome hang on memory errors. Also got "Crash: Failed to execute 'postMessage' on 'MessagePort': Data cannot be cloned, out of memory.", I suppose EP tried sending those 300k events over the MessagePort too... Tried adding proper cleanups of the IDBs after each test but it still refused to run. :(
You might want to hold off on this until we've confirmed the Event Producer is working properly |
OK, seems Event Producer is working for CDF events now |
A bit worried as there is no feature flag to switch back, do we dare to do this with needing a release to be able to roll back if it breaks? |
I'd say it's way easier to roll back a version for our own client than to introduce feature flags in this repo and keep the code side by side. That would grow the bug surface for the release and complicate the API for third parties too... |
*/ | ||
export async function commit(baseCommitData: BaseCommitData) { | ||
/* | ||
This is a workaround to keep the old nested header structure, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the deal with this? I think Haffy might have added a workaround to the SDK if it's the same problem I'm thinking of?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Back-end apparently doesn't use the "enriched header" from event producer yet so I still need these props as well. But if there is a built in work around for that now that'd be nice...
eventSenderStore.eventSender.sendEvent(event); | ||
|
||
if (streamingSessionId) { | ||
await db.delete({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this only mean there can be one event type at a time in the db?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There can be many! They are scoped by name and streamingSessionId. Here's the wrapper: https://github.com/tidal-music/tidal-sdk-web/blob/main/packages/player/src/internal/helpers/event-session.ts
I've had a look through the code here. Give me a bell before you merge this and we can test the events end to end |
streaming metrics cannot be migrated to EP yet. The backend infra does not support enhancing the event payload with client ip which @tidal-gaute and team need. |
setClientPlatform
andsetAppVersion
as that info is gathered from Event Producer config. (And that is only needed for the "old nested header" which should be removed...?)