zulip/static
Steve Howell 3f06f28ad7 sending messages: Extract sent_messages.js.
This commit extract send_messages.js to clean up code related
to the following things:

    * sending data to /json/report_send_time
    * restarting the event loop if events don't arrive on time

The code related to /json/report changes the following ways:

    * We track the state almost completely in the new
      send_messages.js module, with other modules just
      making one-line calls.

    * We no longer send "displayed" times to the servers, since
      we were kind of lying about them anyway.

    * We now explicitly track the state of each single sent
      message in its own object.

    * We now look up data related to the messages by local_id,
      instead of message_id.  The problem with message_id was
      that is was mutable.  Now we use local_id, and we extend
      the local_id concept to messages that don't get rendered
      client side.  We no longer need to react to the
      'message_id_changed' event to change our hash key.

    * The code used to live in many places:
        * various big chunks were scattered among compose.js,
          and those were all moved or reduced to one-line
          calls into the new module
        * echo.js continues to make basically one-line calls,
          but it no longer calls compose.report_as_received(),
          nor does it set the "start" time.
        * message_util.js used to report received events, but
          only when they finally got drawn in the home view;
          this code is gone now

The code related to restarting the event loop if events don't arrive
changes as follows:

    * The timer now gets set up from within
      send_messages.message_state.report_server_ack,
      where we can easily inspect the current state of the
      possibly-still-in-flight message.

    * The code to confirm that an event was received happens now
      in server_events.js, rather than later, so that we don't
      falsely blame the event loop  for a downstream bug.  (Plus
      it's easier to just do it one place.)

This change removes a fair amount of code from our node tests.  Some
of the removal is good stuff related to us completing killing off
unnecessary code.  Other removals are more expediency-driven, and
we should make another sweep at ramping up our coverage on compose.js,
with possibly a little more mocking of the new `send_messages` code
layer, since it's now abstracted better.

There is also some minor cleanup to echo.resend_message() in this
commit.

See #5968 for a detailed breakdown of the changes.
2017-08-01 08:58:56 -07:00
..
assets Change portico navbar style. 2017-02-13 17:02:03 -08:00
audio
generated Move static/third/gemoji to static/generated/emoji. 2016-12-27 20:16:23 -08:00
html frontend: Add header to static/5xx.html. 2017-07-28 17:45:23 -07:00
images Add hotspots svg images. 2017-07-28 16:34:15 -07:00
js sending messages: Extract sent_messages.js. 2017-08-01 08:58:56 -07:00
locale Remove English translations.json from source control. 2017-07-03 10:10:43 -04:00
styles frontend: Fix elements that are not visible should not be focusable. 2017-08-01 08:56:11 -07:00
swagger Delete the old zulip.com "referrals" system. 2017-07-07 14:59:18 -07:00
templates settings: Migrate main settings-change code to API. 2017-07-31 13:08:06 -07:00
third markdown.js: Remove paragraph break from numbered lists. 2017-07-28 12:32:20 -07:00
ts Add typescript support to asset compilation. 2017-05-28 17:28:28 -07:00
.gitignore gitignore: Forget obsolete path static/js/bundle.js . 2017-07-19 14:19:20 -07:00
favicon.ico
node_modules Create static/node_modules symlink. 2016-08-25 15:32:08 -07:00
robots.txt