mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 12:03:46 +00:00 
			
		
		
		
	Zulip has had a small use of WebSockets (specifically, for the code path of sending messages, via the webapp only) since ~2013. We originally added this use of WebSockets in the hope that the latency benefits of doing so would allow us to avoid implementing a markdown local echo; they were not. Further, HTTP/2 may have eliminated the latency difference we hoped to exploit by using WebSockets in any case. While we’d originally imagined using WebSockets for other endpoints, there was never a good justification for moving more components to the WebSockets system. This WebSockets code path had a lot of downsides/complexity, including: * The messy hack involving constructing an emulated request object to hook into doing Django requests. * The `message_senders` queue processor system, which increases RAM needs and must be provisioned independently from the rest of the server). * A duplicate check_send_receive_time Nagios test specific to WebSockets. * The requirement for users to have their firewalls/NATs allow WebSocket connections, and a setting to disable them for networks where WebSockets don’t work. * Dependencies on the SockJS family of libraries, which has at times been poorly maintained, and periodically throws random JavaScript exceptions in our production environments without a deep enough traceback to effectively investigate. * A total of about 1600 lines of our code related to the feature. * Increased load on the Tornado system, especially around a Zulip server restart, and especially for large installations like zulipchat.com, resulting in extra delay before messages can be sent again. As detailed in https://github.com/zulip/zulip/pull/12862#issuecomment-536152397, it appears that removing WebSockets moderately increases the time it takes for the `send_message` API query to return from the server, but does not significantly change the time between when a message is sent and when it is received by clients. We don’t understand the reason for that change (suggesting the possibility of a measurement error), and even if it is a real change, we consider that potential small latency regression to be acceptable. If we later want WebSockets, we’ll likely want to just use Django Channels. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
		
			
				
	
	
		
			186 lines
		
	
	
		
			5.5 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			186 lines
		
	
	
		
			5.5 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| // These declarations tell the TypeScript compiler about the existence
 | |
| // of the global variables for our untyped JavaScript modules.  Please
 | |
| // remove each declaration when the corresponding module is migrated
 | |
| // to TS.
 | |
| 
 | |
| declare let FetchStatus: any;
 | |
| declare let Filter: any;
 | |
| declare let LightboxCanvas: any;
 | |
| declare let MessageListData: any;
 | |
| declare let MessageListView: any;
 | |
| declare let activity: any;
 | |
| declare let admin: any;
 | |
| declare let alert_words: any;
 | |
| declare let alert_words_ui: any;
 | |
| declare let attachments_ui: any;
 | |
| declare let avatar: any;
 | |
| declare let billing: any;
 | |
| declare let blueslip: any;
 | |
| declare let bot_data: any;
 | |
| declare let buddy_data: any;
 | |
| declare let buddy_list: any;
 | |
| declare let channel: any;
 | |
| declare let click_handlers: any;
 | |
| declare let color_data: any;
 | |
| declare let colorspace: any;
 | |
| declare let common: any;
 | |
| declare let components: any;
 | |
| declare let compose: any;
 | |
| declare let compose_actions: any;
 | |
| declare let composebox_typeahead: any;
 | |
| declare let compose_fade: any;
 | |
| declare let compose_pm_pill: any;
 | |
| declare let compose_state: any;
 | |
| declare let compose_ui: any;
 | |
| declare let condense: any;
 | |
| declare let confirm_dialog: any;
 | |
| declare let copy_and_paste: any;
 | |
| declare let csrf_token: any;
 | |
| declare let current_msg_list: any;
 | |
| declare let drafts: any;
 | |
| declare let echo: any;
 | |
| declare let emoji: any;
 | |
| declare let emoji_picker: any;
 | |
| declare let favicon: any;
 | |
| declare let feature_flags: any;
 | |
| declare let feedback_widget: any;
 | |
| declare let fenced_code: any;
 | |
| declare let floating_recipient_bar: any;
 | |
| declare let gear_menu: any;
 | |
| declare let hashchange: any;
 | |
| declare let hash_util: any;
 | |
| declare let helpers: any;
 | |
| declare let home_msg_list: any;
 | |
| declare let hotkey: any;
 | |
| declare let hotspots: any;
 | |
| declare let i18n: any;
 | |
| declare let info_overlay: any;
 | |
| declare let input_pill: any;
 | |
| declare let integration_bot_widget: any;
 | |
| declare let invite: any;
 | |
| declare let keydown_util: any;
 | |
| declare let lightbox: any;
 | |
| declare let list_cursor: any;
 | |
| declare let list_render: any;
 | |
| declare let list_util: any;
 | |
| declare let loading: any;
 | |
| declare let local_message: any;
 | |
| declare let localstorage: any;
 | |
| declare let markdown: any;
 | |
| declare let message_edit: any;
 | |
| declare let message_events: any;
 | |
| declare let message_fetch: any;
 | |
| declare let message_flags: any;
 | |
| declare let message_list: any;
 | |
| declare let message_live_update: any;
 | |
| declare let message_scroll: any;
 | |
| declare let message_store: any;
 | |
| declare let message_util: any;
 | |
| declare let message_viewport: any;
 | |
| declare let muting: any;
 | |
| declare let muting_ui: any;
 | |
| declare let narrow: any;
 | |
| declare let narrow_state: any;
 | |
| declare let navigate: any;
 | |
| declare let night_mode: any;
 | |
| declare let notifications: any;
 | |
| declare let overlays: any;
 | |
| declare let padded_widget: any;
 | |
| declare let page_params: any;
 | |
| declare let panels: any;
 | |
| declare let people: any;
 | |
| declare let pm_conversations: any;
 | |
| declare let pm_list: any;
 | |
| declare let pointer: any;
 | |
| declare let poll_widget: any;
 | |
| declare let popovers: any;
 | |
| declare let presence: any;
 | |
| declare let reactions: any;
 | |
| declare let realm_icon: any;
 | |
| declare let realm_logo: any;
 | |
| declare let recent_senders: any;
 | |
| declare let reload: any;
 | |
| declare let reload_state: any;
 | |
| declare let reminder: any;
 | |
| declare let resize: any;
 | |
| declare let rows: any;
 | |
| declare let rtl: any;
 | |
| declare let schema: any;
 | |
| declare let scroll_bar: any;
 | |
| declare let scroll_util: any;
 | |
| declare let search: any;
 | |
| declare let search_pill: any;
 | |
| declare let search_pill_widget: any;
 | |
| declare let search_suggestion: any;
 | |
| declare let search_util: any;
 | |
| declare let sent_messages: any;
 | |
| declare let server_events: any;
 | |
| declare let server_events_dispatch: any;
 | |
| declare let settings: any;
 | |
| declare let settings_account: any;
 | |
| declare let settings_bots: any;
 | |
| declare let settings_display: any;
 | |
| declare let settings_emoji: any;
 | |
| declare let settings_exports: any;
 | |
| declare let settings_invites: any;
 | |
| declare let settings_linkifiers: any;
 | |
| declare let settings_muting: any;
 | |
| declare let settings_notifications: any;
 | |
| declare let settings_org: any;
 | |
| declare let settings_panel_menu: any;
 | |
| declare let settings_profile_fields: any;
 | |
| declare let settings_sections: any;
 | |
| declare let settings_streams: any;
 | |
| declare let settings_toggle: any;
 | |
| declare let settings_ui: any;
 | |
| declare let settings_user_groups: any;
 | |
| declare let settings_users: any;
 | |
| declare let starred_messages: any;
 | |
| declare let stream_color: any;
 | |
| declare let stream_create: any;
 | |
| declare let stream_data: any;
 | |
| declare let stream_edit: any;
 | |
| declare let stream_events: any;
 | |
| declare let stream_list: any;
 | |
| declare let stream_muting: any;
 | |
| declare let stream_popover: any;
 | |
| declare let stream_sort: any;
 | |
| declare let stream_ui_updates: any;
 | |
| declare let submessage: any;
 | |
| declare let subs: any;
 | |
| declare let tab_bar: any;
 | |
| declare let templates: any;
 | |
| declare let tictactoe_widget: any;
 | |
| declare let timerender: any;
 | |
| declare let todo_widget: any;
 | |
| declare let topic_data: any;
 | |
| declare let topic_generator: any;
 | |
| declare let topic_list: any;
 | |
| declare let topic_zoom: any;
 | |
| declare let top_left_corner: any;
 | |
| declare let transmit: any;
 | |
| declare let tutorial: any;
 | |
| declare let typeahead_helper: any;
 | |
| declare let typing: any;
 | |
| declare let typing_data: any;
 | |
| declare let typing_events: any;
 | |
| declare let ui: any;
 | |
| declare let ui_report: any;
 | |
| declare let ui_util: any;
 | |
| declare let unread: any;
 | |
| declare let unread_ops: any;
 | |
| declare let unread_ui: any;
 | |
| declare let upgrade: any;
 | |
| declare let upload: any;
 | |
| declare let upload_widget: any;
 | |
| declare let user_events: any;
 | |
| declare let user_groups: any;
 | |
| declare let user_pill: any;
 | |
| declare let user_search: any;
 | |
| declare let user_status: any;
 | |
| declare let user_status_ui: any;
 | |
| declare let util: any;
 | |
| declare let widgetize: any;
 | |
| declare let zcommand: any;
 | |
| declare let zform: any;
 |