Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Client crash when a ComponentTrack is added #72

Open
Jdyn opened this issue Mar 20, 2024 · 1 comment
Open

Client crash when a ComponentTrack is added #72

Jdyn opened this issue Mar 20, 2024 · 1 comment

Comments

@Jdyn
Copy link

Jdyn commented Mar 20, 2024

When adding a FileComponent server side to the room with something like

Room.add_component(client, room_id, %Jellyfish.Component.File{ file_path: path })

As soon as the Jellyfish.Notification.ComponentTrackAdded is emitted and the track is sent to the client, the react client crashes due to this access in onTrackEncodingChanged

export const onTrackEncodingChanged = (prevState, peerId, trackId, encoding) => {
    const peer = prevState.remote[peerId];
    const peerTrack = { ...peer.tracks[trackId], encoding };
    ...                         ^^^^^^
};

logs:

Uncaught TypeError: Cannot read properties of undefined (reading 'tracks')
    at onTrackEncodingChanged (stateMappers.js:147:33)
    at onEncodingChanged (stateMappers.js:322:12)

The above error occurred in the <JellyfishContextProvider>
@kamil-stasiak
Copy link
Contributor

Hey, thanks for the report. We'll take care of it as quickly as possible

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants