-
- Downloads
[FIX] mail: prevent race condition in discuss
The discuss application starting process is strongly asynchronous. However, it relies implicitely on the fact that the widget is not destroyed in its starting process. For example, if the widget is detroyed before the updateChannel method is called, then any call to the chat manager service will return undefined and the widget will crash. When discuss is destroyed exactly between the start and the end of the creation of its search view (which is asynchronous), then it is possible to have a crash, because the search view will be destroyed when the do_search method is called. Note that we had to fix discuss mobile as well: The _setChannel method is supposed to return a deferred, but the mobile override did not return it. As a result, a test in the mobile suite failed because this.alive takes a deferred in argument.
Showing
- addons/mail/static/src/js/discuss.js 7 additions, 5 deletionsaddons/mail/static/src/js/discuss.js
- addons/mail/static/src/js/discuss_mobile.js 2 additions, 2 deletionsaddons/mail/static/src/js/discuss_mobile.js
- addons/mail/static/tests/discuss_tests.js 82 additions, 0 deletionsaddons/mail/static/tests/discuss_tests.js
- addons/mail/static/tests/helpers/test_utils.js 1 addition, 2 deletionsaddons/mail/static/tests/helpers/test_utils.js
Loading
Please register or sign in to comment