Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FW][FIX] web_editor: prevent visible traceback from non-blocking RTC error #162825

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Apr 22, 2024

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.

InvalidStateError: Failed to execute 'setLocalDescription' on
'RTCPeerConnection': Called in wrong signalingState: stable
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 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 repeatedly.

opw-3778272

Forward-Port-Of: #162709
Forward-Port-Of: #161518

__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]: odoo@0eca324
[2]: https://github.com/odoo/odoo/blob/a1afcc8/addons/web_editor/static/src/js/wysiwyg/PeerToPeer.js#L374

X-original-commit: cf0743a
@robodoo
Copy link
Contributor

robodoo commented Apr 22, 2024

Pull request status dashboard.

@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 22, 2024

This PR targets saas-17.1 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Apr 22, 2024
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Apr 22, 2024
@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 23, 2024

@Dj0ulo @dmo-odoo child PR #162848 was modified / updated and has become a normal PR. This PR (and any of its parents) will need to be merged independently as approvals won't cross.

@Dj0ulo
Copy link
Contributor

Dj0ulo commented Apr 23, 2024

@fw-bot r+

robodoo pushed a commit that referenced this pull request Apr 23, 2024
__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]: 0eca324
[2]: https://github.com/odoo/odoo/blob/a1afcc8/addons/web_editor/static/src/js/wysiwyg/PeerToPeer.js#L374

closes #162825

X-original-commit: cf0743a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Julien Launois (jula) <jula@odoo.com>
@robodoo robodoo closed this Apr 23, 2024
@Dj0ulo Dj0ulo deleted the saas-17.1-15.0-web_editor-prevent-visible-traceback-from-non-blocking-RTC-error-jula-b9GU-fw branch April 24, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants