mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
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:
@@ -445,7 +445,8 @@ function send_message(request) {
|
|||||||
|
|
||||||
var start_time = new Date();
|
var start_time = new Date();
|
||||||
function success(data) {
|
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();
|
$("#new_message_content").val('').focus();
|
||||||
autosize_textarea();
|
autosize_textarea();
|
||||||
@@ -454,6 +455,12 @@ function send_message(request) {
|
|||||||
clear_message_snapshot();
|
clear_message_snapshot();
|
||||||
$("#compose-send-button").removeAttr('disabled');
|
$("#compose-send-button").removeAttr('disabled');
|
||||||
$("#sending-indicator").hide();
|
$("#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) {
|
if (feature_flags.use_socket) {
|
||||||
|
|||||||
Reference in New Issue
Block a user