* Add a simulation scenario to disconnect signal channel on resume
- Requesting that scenario add that participant to a map with a timeout
of 5 seconds.
- If a resume (reconnect = 1) happens before the timeout, the signalling
channel is closed immediately on resume.
- There is a clean up worker which will remove entries from the map when
they timout.
- The participant is also removed from the map if the disconnect on
resume is invoked once.
* simulate disconnect signal on resume no messages
* comment
* comment
* Close all retries
* update deps
* abort resume only if simulation applied
* Revert SIP change
It is possible that onBindAndConnectedChanged gets executed in such a
way that `writable` does not have the correct value in some very rare
timing case (i. e. case like two executions of the function is racing
and one atomic was read on first exeuction and second execution runs and
sets `writable` and then first execution completes the sets `writable`
to incorrect value based on stale read of first execution).
Prevent it by executing under bind lock.
PacketsLost may not provide useful if repairs are discounting the loss.
So, out-of-order packets are an indication of loss and maybe subsequent
repair. Note that out-of-order could be just out-of-order by a short
amount of time, but a lot of that happening is not good either.
So, out-of-order could provide a decent view of link quality.
* Prevent race of new track and new receiver.
Two different concepts
1. Creation of a new media track
2. Creation of a new receiver inside the media track
collided and caused track published to not be fired.
Unify to mark creation of new receiver as the source of truth.
With simulcast codecs, creation of a new receiver should be treated as a
new published track.
* Fire onTrackPublished only on new track
* Synthesise codec when adding pending track for no simulcast case also.
Older clients not using simulcast codecs were failing e2e migration
tests. Problem is that they did not have layer information and hence
SSRC could not be set on migration.
A codec was getting added later (when OnTrack was received). I missed
adding layers in that code. Could have cloned layers there and added it.
But, simplifying and adding at the start itself.
Also, cleaning up code in `MediaTrackReceiver` for no codecs case as it
should not happen any more.
* clone per layer
* fix priority determination
Previously, it was done on read. Missed populating it on write
in the TrackInfo consolidation effort.
Fix by populating layers when adding pending track itself.
As all codecs will have same layers, clone the top level layers and add
it all codecs.
* Consolidate TrackInfo.
TrackInfo was spread across a bit. Consolidating it.
* TODO comments
* test
* update TrackInfo on SSRC change
* further consolidation
* log mimes only
* update receivers on SSRC set
* clone proto on return
* feedback: break loop on mime match
* prevent data race
Need to store identity of other partiicpant in cache so that it
can be sent with the disconnected participant update.
Side note: Feels like the cache can be made to hold the full proto
to make things simpler, but just adding a field for now.