compose: restart the get_updates loop 2s after sending a message.

This should substantially mitigate the get_updates failures that we've
been seeing, since users will experience a 2s-slow send, not a 0-60
second slow send.

We should revert this once we resolve the root problem.

(imported from commit b665d0dfe674e1113bdd62cef50e3d9c52758e4c)
This commit is contained in:
Tim Abbott
2013-11-07 15:00:25 -05:00
parent b715e15d3d
commit 1a97f194e9

View File

@@ -445,7 +445,8 @@ function send_message(request) {
var start_time = new Date();
function success(data) {
process_send_time(data.id, start_time);
var message_id = data.id;
process_send_time(message_id, start_time);
$("#new_message_content").val('').focus();
autosize_textarea();
@@ -454,6 +455,12 @@ function send_message(request) {
clear_message_snapshot();
$("#compose-send-button").removeAttr('disabled');
$("#sending-indicator").hide();
setTimeout(function () {
if (exports.send_times_data[message_id].received === undefined) {
blueslip.debug("Restarting get_updates");
restart_get_updates();
}
}, 2000);
}
if (feature_flags.use_socket) {