__Current behavior before commit:__
Sometimes the following tracebacks are popping up when an RTC connection
is being established between two users trying to edit the same document.
```log
InvalidStateError: Failed to execute 'setLocalDescription' on
'RTCPeerConnection': Called in wrong signalingState: stable
```
```log
InvalidStateError: Failed to execute 'setRemoteDescription' on
'RTCPeerConnection': Called in wrong signalingState: stable
```
__Description of the fix:__
These errors are not blocking and don't impact the successful ensuing
RTC connection. Thus, we can just catch the error and log it in the
console instead of showing it to the user.
__Steps to reproduce the issue (in 17):__
- Go to a knowledge article
- Open a new tab and open the same article
- On this new tab, quit the article and come back multiple times
Eventually a traceback will appear on one of the tab.
Note that this error seems to occur very randomly. It is similar to the
one dealt by [this commit][1] and it is probably due to a similar cause
i.e. a browser bug when the RTC connection is under stress.
It is however possible to trigger it in a more consistent way by calling
[_createClient][2] repeatedly.
opw-3778272
[1]: https://github.com/odoo/odoo/pull/158861/commits/0eca324
[2]: https://github.com/odoo/odoo/blob/a1afcc8/addons/web_editor/static/src/js/wysiwyg/PeerToPeer.js#L374closesodoo/odoo#162709
X-original-commit: 034d45b6cde6d818755128778fdcf99dd9ff1254
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Julien Launois (jula) <jula@odoo.com>