zulip/zerver/views
Anders Kaseorg ea6934c26d dependencies: Remove WebSockets system for sending messages.
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>
2020-01-14 22:34:00 -08:00
..
development scripts: Move inline-email-css from tools to scripts. 2019-11-15 17:39:42 -08:00
__init__.py
alert_words.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
archive.py archive: Fix calculation of gravatar URL. 2019-11-15 17:14:44 -08:00
attachments.py uploads: Show used upload space in attachments UI. 2019-03-07 20:18:00 -08:00
auth.py auth: Use config_error instead of JsonableError in remote_user_sso. 2019-12-11 16:40:20 -08:00
camo.py camo: Clean up type ignores. 2019-08-09 16:39:16 -07:00
compatibility.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
custom_profile_fields.py do_update_user_custom_profile_data: Rename to ..._if_changed. 2019-10-01 13:52:43 -07:00
digest.py digest: Fix the styling of /digest page. 2019-01-07 13:09:29 -08:00
documentation.py request: Tighten type checking on REQ. 2019-11-13 12:35:55 -08:00
email_mirror.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
events_register.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
home.py dependencies: Remove WebSockets system for sending messages. 2020-01-14 22:34:00 -08:00
hotspots.py views: Fix imports of REQ/has_request_variables from the wrong place. 2017-10-27 15:07:31 -07:00
invite.py decorator: Extract OrganizationAdministratorRequired common exception. 2019-11-18 15:10:56 -08:00
messages.py recipients: Remove bulk_get_recipients function and its uses. 2019-12-12 12:00:13 -08:00
muting.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
pointer.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
presence.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
push_notifications.py push_notifications: Declare token of type str, not bytes. 2019-11-12 23:21:20 -08:00
reactions.py api: Remove legacy emoji reactions endpoint. 2019-11-12 13:07:06 -08:00
realm.py realm: Add private_message_policy setting. 2020-01-13 12:20:42 -08:00
realm_domains.py lint: Fix calls to _() on computed strings. 2019-04-23 15:23:03 -07:00
realm_emoji.py openapi: Fix handling of parameters passed via the URL/path. 2019-08-19 15:06:08 -07:00
realm_export.py billing: Change RealmAuditLog.event_type from str to int. 2019-10-06 15:55:56 -07:00
realm_filters.py views: Remove unused imports. 2019-02-02 17:23:43 -08:00
realm_icon.py zerver/views: Use python 3 syntax for typing. 2017-10-26 21:58:22 -07:00
realm_logo.py realm_logo: Remove redundant `realm_logo_url` function. 2019-08-20 12:07:20 -07:00
registration.py find_team: Send find team emails from the support address. 2020-01-08 21:55:34 -08:00
report.py settings: Unset STATIC_ROOT in development. 2019-07-24 17:40:31 -07:00
storage.py views: Remove unused imports. 2019-02-02 17:23:43 -08:00
streams.py wildcard_mentions_notify: Add per-stream override of global setting. 2019-12-09 16:09:38 -08:00
submessage.py views: Remove unused imports. 2019-02-02 17:23:43 -08:00
thumbnail.py views: Remove unused imports. 2019-02-02 17:23:43 -08:00
tutorial.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
typing.py request: Remove ExtractRecipients type safety hole on REQ. 2019-08-07 15:26:59 -07:00
unsubscribe.py emails: Move clear_scheduled_*emails to send_email.py. 2019-03-15 11:02:17 -07:00
upload.py upload: Fix browser caching of uploads with local uploads backend. 2019-10-01 15:15:17 -07:00
user_groups.py decorator: Extract require_user_group_edit_permission. 2019-11-18 15:13:29 -08:00
user_settings.py invitations: Improve experience around reactivating users. 2020-01-13 18:30:51 -08:00
users.py auth: Use zxcvbn to ensure password strength on server side. 2019-11-21 10:23:37 -08:00
video_calls.py compose: Add support for using Zoom as the video chat provider. 2019-01-07 10:00:02 -08:00
zephyr.py zephyr: Fix typing for cred parameter. 2019-07-29 15:23:10 -07:00