We don't want to depend on:
1) socket.io generated IDs because they change on server reconnect
2) simple-peer generated IDs because they change for every peer
connection
We generate a single ID when the call web page is refreshed and use that
throughout the session (until page refresh).
We keep relations of user-id to socket-id on the server side in memory
and use that to get to the right socket. In the future this might be
replaced with Redis to allow multiple nodes.
If the server is restarted, but people have active calls, we want them
to keep using the active peer connections and only connect to new peers.
Ideally, we do not want to disturb the active peer connections, but peer
connections might be restarted because the in-memory store will not have
the information on for any peers in the room upon restart.
The addStream and removeStream are deprecated and the MDN docs
recommend using addStream/removeStream instead.
While we add tracks, we can also add event listeners to whether or not a
track has ended and then remove a stream once all tracks in the streams
have ended.
I'm not clear on why this is needed (currently offline so cannot check).
Browserify doesn't work without it since we removed pug which bundled
a bunch of weird dev libraries, such as acorn (commit 2d14e5f).
Pug contains a lot of unnecessary dependencies leading to code bloat,
which results in increased docker package size, and thus docker image
size). express-dot-engine is much simpler and performs better.