Commit Graph

7925 Commits

Author SHA1 Message Date
Tim Abbott 2e62cd5a74 Add tests for the events_register event application system.
(imported from commit 6c3dbe55d43f528b6a980bba3598ac30c0307a69)
2013-12-12 17:36:41 -05:00
Tim Abbott a3d67a7fe7 Fix apply_events for subscription events to actually match.
Since we changed the initial subscription data to include
user_profile_ids rather than emails, we need to preserve that when
adding in events generated during the page load.

(imported from commit 4f4071b8ba30e57c6f64c9e7b54c1cc754e8f010)
2013-12-12 17:36:40 -05:00
Tim Abbott 8af0fae335 Fix missing muted topics in apply_events.
These events would previously not be applied.

(imported from commit c3e5b9de559b6f744567a0c78e920d34e4d5ae9a)
2013-12-12 17:36:40 -05:00
Tim Abbott afdf7897e6 Split out helper functions from do_events_register.
(imported from commit d838a3303d3ec960d076e755fc8690da5151ac1a)
2013-12-12 17:36:40 -05:00
Tim Abbott a3fe72642b Add save/reload of narrows of server restart.
(imported from commit 2ad77845ce7d8fe365c893ab5cad06e3c725b421)
2013-12-12 17:36:39 -05:00
Tim Abbott 71ad82b6aa Add support for event queues with an included narrow.
This will allow us to substantially decrease the server-side work that
we do to support our Mirroring systems (since the personal mirrors can
request only messages that user sent) and also is what we need to
support a single-stream Zulip widget that we embed in webpages.

(imported from commit 055f2e9a523920719815181f8fdb44d3384e4a34)
2013-12-12 17:36:39 -05:00
Tim Abbott 48963c1cdf Replace accepts_event_type with accepts_event.
This is in preparation for allowing queues to only accept some
messages.

(imported from commit 6bca11a9084aeff52931762085c4c771edbce56e)
2013-12-12 17:36:38 -05:00
Tim Abbott bd977e9e5c Add a basic test for the get_events API backend.
(imported from commit 6f5351947f2b30f13c3309720c8c7c2187d16d51)
2013-12-12 17:36:38 -05:00
Tim Abbott d6aa8ecaff Only send get_updates_xhr error if we don't have a timeout either.
(imported from commit b77c6c67917f8d2bc5d59fb46f3a5ffa4a0ac443)
2013-12-12 17:36:38 -05:00
Tim Abbott b8579c6848 Disconnect handlers if the client closes a connection.
Tested using the following procedure (run-dev.py won't pass through
the client connect closing)

tabbott@monastery:~/zulip$ curl http://localhost:9991/api/v1/register  -u email:key  -d 'event_types=["message"]'
{"msg":"","max_message_id":2259,"last_event_id":-1,"result":"success","queue_id":"1386884005:0"}
tabbott@monastery:~/zulip$ curl -G http://localhost:9993/api/v1/events  -u email:key -d "last_event_id=0" -d "queue_id=1386884005:0"
(then hit ctrl-C)

(imported from commit 3c4f3d5caac97b3de53da994ff9cd9ef67b2b9ea)
2013-12-12 16:52:25 -05:00
Tim Abbott cc0ce6b437 Finish event handlers when disconnecting from an event queue.
This should help prevent timeouts from clients whose requests have
been supplanted.

(imported from commit fdb3a89c4ec02bb23d0fba50ea558d48cb786916)
2013-12-12 16:52:25 -05:00
Tim Abbott 950e4c800b puppet: Declare upstreams properly in app nginx config.
(imported from commit 859eeed0d5b92c1b5b2b0764aba06aebcde8e2e2)
2013-12-12 16:48:52 -05:00
Tim Abbott 7159564881 Cancel existing get_updates requests before making a new one.
(imported from commit fdc1223acb0cbd92cc6e0cd83230db97b67ff5b4)
2013-12-12 16:03:46 -05:00
Tim Abbott 2aad7baac0 Restart get_updates if it is ever not running while sending a message.
(imported from commit 12d74c1193dd978e171d2e2aaf236ad71bebe6a3)
2013-12-12 16:03:45 -05:00
Tim Abbott 7a397480e5 Log a blueslip message when unsuspending.
(imported from commit 8a8509ea47f3c9c6e56f98795acc958507564ff9)
2013-12-12 16:03:45 -05:00
Tim Abbott ae4d214c49 Fix longpolling treatment for api.zulip.com/v1/events.
(imported from commit 78029972938ad7c9aa862330e38965b4b032c935)
2013-12-12 16:03:45 -05:00
Tim Abbott 73f04b21e9 Add zulip.customer29.invalid host.
(imported from commit ea3e7bb465c920b8ec21b7471cd261868f5059e7)
2013-12-12 16:03:45 -05:00
Tim Abbott c21e85e569 Remove staging.humbughq.com loadbalancer config.
The DNS has been disabled for some time.

(imported from commit e054c0fb0b37077d8303eab4d4ffec6ff53e8990)
2013-12-12 16:03:45 -05:00
Steve Howell da69fc19de Fix width checks for skinny mode.
We now use window.innerWidth to check for CUSTOMER7's skinny
mode, which empirically seems to be more consistent with
CSS's max-width @media settings.

I tested under FF, Safari, and Chrome.

(imported from commit d440998634633c11b471fe732104be252c979cd4)
2013-12-12 15:41:17 -05:00
Steve Howell 009d1ed88a DRY up check for feature_flags.left_side_userlist.
(imported from commit d7cbb1eee0e83ddf811451e10dd6dcd03c86ffd0)
2013-12-12 15:41:16 -05:00
Steve Howell b53513a5e7 Uncondense messages that have recently become "short."
It's possible for a message to be considered "long" at one point,
and then if you narrow to it later, it should be considered "short",
because either the screen's wider or taller.  This commit makes
sure that we remove the "condensed" flag from short messages,
and it also fixes the "More..." click handler's assumption that
could-be-condensed will always be true for condensed messages.

(imported from commit 77e4a1ad299c09f12e5609a972d5668472bd4a81)
2013-12-12 15:38:38 -05:00
Steve Howell 7427fb8d98 Cache message heights for ui.condense_and_collapse().
Cache the height of messages to speed up ui.condense_and_collapse()
to make narrows work more quickly.  The height of the message
determines whether it is auto-condensed or not.  We clear specific
cache entries when messages get edited, and we reset the entire
cache when the window width changes.

(imported from commit 7c12070a3eb3e2e1a2dfeb8d9109f3404a46c032)
2013-12-12 15:38:38 -05:00
Steve Howell e1727844d7 Only condense/collapse when messages are visible.
Trying to condense messages when they are not yet visible just
leads to wasted effort and wrong results.

This commit makes it so that current_msg_list always points to a
visible list, so the code related to message rendering knows when
to call ui.condense_and_collapse().  For activating narrows, we
now let rendering handle the condense/collapse case.

The home view situation is a little trickier, because we render
new messages in the home view even when we're inside inside of a narrow,
presumably to make it fast to switch into the home view.  When
we actually go back to the home view, we need to sweep for messages
that might need to be condensed, since they have been originally
rendered while the home view was not visible.

(imported from commit 4da2d278a4353e9e0c2b98cbf8c9dd03b06cd59b)
2013-12-12 15:38:38 -05:00
Zev Benjamin cb00b56b8f Send shorter browser error reports to Zulip
(imported from commit 80827f7929215007c26b2445732ee5a37f632c07)
2013-12-12 12:52:21 -05:00
Jessica McKellar b6e46986f0 Remove unused message_tour.js.
(imported from commit e25a9315377ad11d47ad78a5d466df40e306f713)
2013-12-12 11:47:09 -05:00
Jessica McKellar 14cbcfce3b Disable Dropbox integration feature flag for us.
(imported from commit 1496be96e0011f23f5a714e0eaf36f477a830577)
2013-12-12 11:47:09 -05:00
Jessica McKellar ebb0d82c83 Rename Humbug to Zulip in a few lingering places.
(imported from commit ed74de98ca01914318be10453544e9fb4fb981b4)
2013-12-12 11:47:08 -05:00
Steve Howell 680cd159c5 Add more template testing.
This adds coverage on all of our handlebars templates.  It renders
each template with representative data and generally performs at
least one sanity check on the DOM that gets created.

Also, the tests output the rendered HTML to .test-js-with-node.html,
which can serve as a way of documenting all of our templates.

(imported from commit 63dd7502457a8199dd35277fc5ab80cd53e2af22)
2013-12-12 11:32:46 -05:00
Steve Howell bc2848b41e Rename messages.js test to templates.js
(imported from commit fcd08cd862db0d7f7f212c6211dc8b259390393c)
2013-12-12 11:32:46 -05:00
Tim Abbott 08ac439d0f Improve comments for remaining legacy API endpoints.
(imported from commit 923b30b4c2a8e724ce8262e9eaeb69887572fd4b)
2013-12-12 10:31:05 -05:00
Tim Abbott 0a7c6ac261 Remove legacy /api/v1/update_pointer endpoint.
(imported from commit 4e2d111cf00ab2064291b282795c4b89835d1c17)
2013-12-12 10:31:05 -05:00
Tim Abbott 0c79465950 Remove legacy /api/v1/get_profile endpoint.
(imported from commit c8e78be4c8549022556099cc13342627323c0b01)
2013-12-12 10:31:05 -05:00
Tim Abbott 01428e5076 Remove legacy /api/v1/get_old_messages endpoint.
(imported from commit 2ca426f08f9f862e756a1fda55bb2764997aeb76)
2013-12-12 10:31:04 -05:00
Tim Abbott 795f716daf Remove legacy /api/v1/get_public_streams endpoint.
(imported from commit 49db0232e7f655308847f3ccef2b73368ab9b774)
2013-12-12 10:31:04 -05:00
Tim Abbott 2f1382d0b8 Change test names in running printout to be what test-backend takes.
(imported from commit 330aa6ca4ad5f8ebfe30042039d4a04d78f1691f)
2013-12-12 10:31:04 -05:00
Tim Abbott 0a952b1a66 Fix abuse of bugging login behavior with API URLs.
(imported from commit 3009cd094dff8891da415e1bfcf596ea6cb38abc)
2013-12-12 10:31:04 -05:00
Tim Abbott 33cdf0d019 Remove obsolete /api/v1/subscriptions/add endpoint.
(imported from commit 838e3a29219acf157f16258a46b0719d97ae46de)
2013-12-12 10:31:04 -05:00
Tim Abbott 46760e91cd rest_dispatch: Don't allow session auth on /api URLs.
This caused problems with our tests suite where we were using a logged
in browser session and actually acting as a different user.

(imported from commit 73b8cb39d5d669e682fbacf2f7e574c228885c2f)
2013-12-12 10:31:04 -05:00
Tim Abbott 664270a1c4 tests: Add put/delete helpers to avoid manually urlencoding.
(imported from commit 120b564b27ffd711e0f4e63279971433fb4aaa9b)
2013-12-12 10:31:04 -05:00
Tim Abbott 752e7aa84a Remove obsolete /api/v1/subscriptions/remove endpoint.
(imported from commit 9fc6bdb4cc288aa7499399d1d281fb752ea3a52e)
2013-12-12 10:31:03 -05:00
Tim Abbott 23a3b078d6 Remove legacy /api/v1/get_subscribers endpoint.
(imported from commit 52ab7b1200c2a62d1f8c251ab8d2f187cd2eb50b)
2013-12-12 10:31:03 -05:00
Tim Abbott cacd60860a Remove legacy /api/v1/subscriptions/list endpoint.
(imported from commit 457ceec760488815a24b5695362a42f4a94aabdc)
2013-12-12 10:31:03 -05:00
Tim Abbott fe2e5cdcf1 Remove unused /json/get_members endpoint.
The same data is still available tot he browser via the /json/users
API endpoint.

(imported from commit aeacee9de8542961d3c877ce08ae483b0b8bdc80)
2013-12-12 10:31:03 -05:00
Tim Abbott 77c2a14822 Remove obsolete /api/v1/get_members endpoint.
(imported from commit a5013c5e74d9e36a9a80c6fabd7b8461cbdf7e4a)
2013-12-12 10:31:03 -05:00
Tim Abbott 85ef4988e1 Add api_key to filtered variables.
We don't use it yet, but the plan is the migrate there and it's better
to just have the filtering in place.

(imported from commit d0e7f40e8a439b8e8751da954e79b5f67226e5a9)
2013-12-12 10:31:03 -05:00
Tim Abbott 86fe801944 Fix default propagate mode name to use proper _ conventions.
As far as I can tell, we don't actually use this value, but better to
have it be clear.

(imported from commit 3655b87f28b0554ee3db0acb2c0d59543dd093a1)
2013-12-12 10:31:03 -05:00
Tim Abbott 291506a2b2 Add logging for when we disconnected an active handler.
(imported from commit 18c21a93bdf14485e5656bd7a38f2069eb8f2aad)
2013-12-11 17:23:56 -05:00
Tim Abbott fcf6ec16aa Fix pruning of event queues that only had virtual events.
(imported from commit 7b43d2164df6e95a6feb073b8f90c0862245d629)
2013-12-11 17:20:34 -05:00
Tim Abbott b10278c8e0 events: Fix incorrectly empty event queues with virtual events.
I'm not sure this had much impact, but it's definitely a subtle bug.

(imported from commit 0260d4c5c35ce8eac683e84f1d939a6704ce4e2b)
2013-12-11 16:59:48 -05:00
Tim Abbott df730ec163 Fix json_unauthorized.
(imported from commit 7537b3bbc21b947f91ec49060935e9e2f92be0ac)
2013-12-11 16:45:29 -05:00