Skip to content

Commit

Permalink
Cleanup emitter transform from all the SDKs (#852)
Browse files Browse the repository at this point in the history
* Remove emitter transform for the Video Web API

* pubSubChannel comment

* test script update

* remove transform pipeline for video.recording.list

* emit the room.joined event through new emitter

* test roomSessionStreaming with new emitter

* recording list with new emitter

* playback and stream list with new emitter

* Update roomSessionStreaming.spec.ts

* init video worker with video stream worker

* video record worker init

* start recording and stream function with new emitter

* e2e test cases with new record and stream workers

* video playback worker with new emitter

* room.joined event emit through new emitter

* new emitter for video manager

* fix unit test case for the video manager

* remove getEmitterTransform from the BaseRoomSession

* remove events from the old videoAPIWorker

* enable end to end test for realtime video

* enable e2e for js

* listen for member.talking events through new emitter

* handle room.subscribed with base emitter

* listen for event through new emitter is e2e realtime

* consider room.left event from the new emitter

* fix _off event for realtime room session

* override on, once, off in base connection

* override on, once, off in base connection

* spawn member position worker by the video worker

* temporary skip the bad network test

* temporary skip the bad network test

* fix roomSession playback and recording serialization

* cleanup the code

* fix ci cd typo

* fix member position worker test

* override event attach in BaseRoomSession

* remove video prefix from the event

* fix undefined error in mediaElementSaga

* prefix video on subscription

* enable roomSessionBadNetwork e2e test cases

* overriden functions for room session device and screen share

* changeset include

* override the subscription method for video manager

* fix video manager unit test

* fix room session member unit test

* fix TS issues

* remove TODO from the subscribe worker

* fix TS Call issues

* add unit test for strip namespace function

* use super .once for realtime room session

* fix subscription bug for realtime api

* fix type for events in realtime room session

* fix race condition for task namespace

* Remove applyEmitterTransform function from all the SDKs  (#839)

* Remove applyEmitterTransform function from all the SDKs

* allow CI to run on the current branch

* changeset include

* remove branch from the CI

* Remove eventsPrefix from the namespaces (#840)

* Remove eventsPrefix from the namespaces

* run the CI

* fix base component unit test

* remove event prefix from the base component

* include changeset

* remove branch from the CI

* Shared functions enhancement (#843)

* Shared functions enhancement

* run the CI

* rename room session stream and record instances

* rename all the RT methods

* include changeset

* fix start recording test

* remove branch from the CI

* fix member list update event

* Introduce the session emitter and eliminate the global emitter (#845)

* Eliminate the pubSubChannel and global emitter

* run the CI

* introduce session emitter

* fix unit tests

* fix unit tests

* use session events through new session emitter

* emit through session emitter in pubSubSaga

* fix test case for messaging client

* video sdk without global emitter

* ts improve

* remove the old event listeners from the BaseComponent

* remove find namespace from the member position worker

* cleanup base component utilities

* cleanup and remove the attach listeners

* cleanup the old emitter usage

* remove _on, _once, _off

* improve ts typings

* fix build issue

* remove proxy utils

* remove unused getCompoundEvents

* include changeset

* fix build issue

* Cleanup the global emitter (#848)

* Cleanup the global emitter

* run the CI

* fix build issue

* fix ts issues

* include changeset

* Eliminate the multicast pubsub channel (#850)

* emit through session emitter instead of put on pubsub channel

* run the CI

* remove the usage of pubsub channel

* include changeset

* cleanup unused actions

* fix build issue

* Attach listeners without the namespace prefix (#851)

* fix unit tests

* video sdk without global emitter

* ts improve

* cleanup the old emitter usage

* Attach listeners without the namespace prefix

* fix build issue

* include changeset

* stop the voicePass.test

* allow voicePass.test

* fallback to the prev e2e task test

* emit through new emitter in task API
  • Loading branch information
iAmmar7 committed Aug 16, 2023
1 parent bb50b2f commit a94ef4b
Show file tree
Hide file tree
Showing 150 changed files with 1,910 additions and 4,323 deletions.
8 changes: 8 additions & 0 deletions .changeset/brown-seahorses-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@signalwire/realtime-api': patch
'@signalwire/webrtc': patch
'@signalwire/core': patch
'@signalwire/js': patch
---

Enhance shhared function between realtime and browser SDK
8 changes: 8 additions & 0 deletions .changeset/dull-beers-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@signalwire/realtime-api': patch
'@signalwire/webrtc': patch
'@signalwire/core': patch
'@signalwire/js': patch
---

Introduce the session emitter and eliminate the global emitter
7 changes: 7 additions & 0 deletions .changeset/khaki-avocados-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@signalwire/webrtc': patch
'@signalwire/core': patch
'@signalwire/js': patch
---

Eliminate the multicast pubsub channel
7 changes: 7 additions & 0 deletions .changeset/nasty-olives-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@signalwire/realtime-api': patch
'@signalwire/webrtc': patch
'@signalwire/core': patch
---

Cleanup the SDK by removing eventsPrefix from the namespaces
7 changes: 7 additions & 0 deletions .changeset/popular-doors-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@signalwire/realtime-api': patch
'@signalwire/core': patch
'@signalwire/js': patch
---

Attach listeners without the namespace prefix
8 changes: 8 additions & 0 deletions .changeset/silver-needles-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@signalwire/realtime-api': patch
'@signalwire/webrtc': patch
'@signalwire/core': patch
'@signalwire/js': patch
---

Cleanup the SDK by removing applyEmitterTransform
8 changes: 8 additions & 0 deletions .changeset/tough-ads-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@signalwire/realtime-api': patch
'@signalwire/webrtc': patch
'@signalwire/core': patch
'@signalwire/js': patch
---

Cleanup the global emitter
11 changes: 11 additions & 0 deletions .changeset/tough-cows-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@sw-internal/e2e-realtime-api': patch
'@signalwire/realtime-api': patch
'@sw-internal/stack-tests': patch
'@sw-internal/e2e-js': patch
'@signalwire/webrtc': patch
'@signalwire/core': patch
'@signalwire/js': patch
---

Remove event emitter transform pipeline from browser SDK
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
push:
branches: [main]
pull_request:
branches: [main, dev]
branches:
[main, dev, aa/video-emitter-transform, aa/channels, aa/cleanup-emitter]
workflow_dispatch:

concurrency:
Expand Down
28 changes: 26 additions & 2 deletions internal/e2e-js/tests/roomSession.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,15 @@ test.describe('RoomSession', () => {
const recordingEnded = new Promise((resolve) => {
roomObj.on('recording.ended', (params) => {
if (params.id === recording.id) {
resolve(params)
const paramWithGetters = {
id: params.id,
roomSessionId: params.roomSessionId,
state: params.state,
pause: params.pause,
resume: params.resume,
stop: params.stop,
}
resolve(paramWithGetters)
}
})
})
Expand Down Expand Up @@ -722,7 +730,23 @@ test.describe('RoomSession', () => {
const playbackEnded = new Promise((resolve) => {
roomObj.on('playback.ended', (params) => {
if (params.id === playback.id) {
resolve(params)
const paramWithGetters = {
id: params.id,
roomSessionId: params.roomSessionId,
state: params.state,
seekable: params.seekable,
startedAt: params.startedAt,
url: params.url,
volume: params.volume,
forward: params.forward,
pause: params.pause,
resume: params.resume,
rewind: params.rewind,
seek: params.seek,
setVolume: params.setVolume,
stop: params.stop,
}
resolve(paramWithGetters)
}
})
})
Expand Down
19 changes: 15 additions & 4 deletions internal/e2e-js/tests/roomSessionStreaming.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,21 @@ test.describe('RoomSession', () => {
})
)

const streamSerializer = (stream: any) => {
return {
id: stream.id,
roomSessionId: stream.roomSessionId,
state: stream.state,
url: stream.url,
stop: stream.stop,
}
}

resolve({
streamsOnJoined: params.room_session.streams,
streamsOnGet: result.streams,
streamOnEnd,
streamsOnJoined:
params.room_session.streams?.map(streamSerializer),
streamsOnGet: result.streams.map(streamSerializer),
streamOnEnd: streamOnEnd.map(streamSerializer),
})
})

Expand All @@ -125,7 +136,7 @@ test.describe('RoomSession', () => {

expect(streamsOnJoined.length).toEqual(streamsOnGet.length)
expect(streamsOnGet.length).toEqual(streamOnEnd.length)
;[streamsOnJoined, streamsOnGet, streamsOnGet].forEach((streams: any[]) => {
;[streamsOnJoined, streamsOnGet, streamOnEnd].forEach((streams: any[]) => {
streams.forEach((stream) => {
// Since functions can't be serialized back to this
// thread (from the previous step) we just check that
Expand Down
33 changes: 0 additions & 33 deletions packages/core/src/ApplyEventListeners.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/core/src/BaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ export class BaseClient<
> extends BaseComponent<EventTypes> {
constructor(public options: BaseClientOptions<EventTypes>) {
super(options)
/**
* Since we don't need a namespace for these events
* we'll attach them as soon as the Client has been
* registered in the Redux store.
*/
this._attachListeners('')
}

/**
Expand Down
Loading

0 comments on commit a94ef4b

Please sign in to comment.