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

bug on the sample code #22

Open
dotku opened this issue Aug 25, 2020 · 1 comment
Open

bug on the sample code #22

dotku opened this issue Aug 25, 2020 · 1 comment

Comments

@dotku
Copy link

dotku commented Aug 25, 2020

the sample code

roomRef.onSnapshot(async snapshot -> {
    console.log('Got updated room:', snapshot.data());
    const data = snapshot.data();
    if (!peerConnection.currentRemoteDescription && data.answer) {
        console.log('Set remote description: ', data.answer);
        const answer = new RTCSessionDescription(data.answer)
        await peerConnection.setRemoteDescription(answer);
    }
});

should use => instead of ->

on this page:
https://webrtc.org/getting-started/firebase-rtc-codelab

@dzjones26
Copy link

another bug on sample code

  const roomRef = await db.collection('rooms').add(roomWithOffer);
  const roomId = roomRef.id;

Need to turn const roomId into a global variable roomId
Otherwise, in the state of no callee, the caller execution hangup will not delete the room on firestore, because the roomId is null.

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