summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2019-12-06 13:33:13 +0000
committerAlexandre Kühn <aku@odoo.com>2019-12-09 09:26:25 +0000
commit42de9e129f0832c57ad3845bcbfc9c5b3b1bb301 (patch)
tree7940324c0970b820ebf035d2bebd5aa6b8efeb7e /addons/mail/static/src/js
parent4efe0e3b161a46d4d0528df91a825c55cc96fb65 (diff)
[REV] mail: prevent message loss during connection issue
This reverts commit e5479fcfdb76bdbf9301fb140d873483bafdb9e4. This commit prevented an issue of losing messages on post in case of connectivity loss. The implementation consists of keeping the content in the composer until the server acknowledges handling the message. However, this solution introduces significant issues. For instance, sending messages in quick succession will likely loose or duplicate some content, based on how fast/slow the RPC `message_post` is resolved. Plus, there was an issue on mobile because the input focus was lost during the RPC. As a consequence, the virtual keyboard flickered. The intent was to fix a rare issue, and since the problems of this solution clearly outweigh the gain, we decided to revert. closes odoo/odoo#41544 X-original-commit: 36b2e99e08bfc6d92a821d0346e783695580abf9 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/js')
-rw-r--r--addons/mail/static/src/js/composers/basic_composer.js7
-rw-r--r--addons/mail/static/src/js/discuss.js4
-rw-r--r--addons/mail/static/src/js/thread_windows/abstract_thread_window.js4
3 files changed, 5 insertions, 10 deletions
diff --git a/addons/mail/static/src/js/composers/basic_composer.js b/addons/mail/static/src/js/composers/basic_composer.js
index bfd97028a2d..c2ca59ffa65 100644
--- a/addons/mail/static/src/js/composers/basic_composer.js
+++ b/addons/mail/static/src/js/composers/basic_composer.js
@@ -523,10 +523,9 @@ var BasicComposer = Widget.extend({
clearTimeout(this._cannedTimeout);
var self = this;
this._preprocessMessage().then(function (message) {
- self.trigger('post_message', message, function() {
- self._clearComposerOnSend();
- self.$input.focus();
- });
+ self.trigger('post_message', message);
+ self._clearComposerOnSend();
+ self.$input.focus();
});
},
/**
diff --git a/addons/mail/static/src/js/discuss.js b/addons/mail/static/src/js/discuss.js
index 0f2b7feff26..168e74cac4a 100644
--- a/addons/mail/static/src/js/discuss.js
+++ b/addons/mail/static/src/js/discuss.js
@@ -1490,9 +1490,8 @@ var Discuss = AbstractAction.extend({
/**
* @private
* @param {Object} messageData
- * @param {Function} callback
*/
- _onPostMessage: function (messageData, callback) {
+ _onPostMessage: function (messageData) {
var self = this;
var options = {};
if (this._selectedMessage) {
@@ -1513,7 +1512,6 @@ var Discuss = AbstractAction.extend({
} else {
self._threadWidget.scrollToBottom();
}
- callback();
});
},
/**
diff --git a/addons/mail/static/src/js/thread_windows/abstract_thread_window.js b/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
index 27cb97e1f65..7ec1c214ef1 100644
--- a/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
+++ b/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
@@ -372,9 +372,8 @@ var AbstractThreadWindow = Widget.extend({
*
* @private
* @param {Object} messageData
- * @param {Function} callback
*/
- _postMessage: function (messageData, callback) {
+ _postMessage: function (messageData) {
var self = this;
if (!this.hasThread()) {
return;
@@ -382,7 +381,6 @@ var AbstractThreadWindow = Widget.extend({
this._thread.postMessage(messageData)
.then(function () {
self._threadWidget.scrollToBottom();
- callback && callback();
});
},
/**