Commit Graph

32784 Commits

Author SHA1 Message Date
Tim Abbott fac886ce05 Revert "compose: Fix cursor placement timing bug when selecting a typeahead."
This reverts commit 76e50af78e.

Empirically, this caused weird issues with the cursor jumping around,
so more investigation is required into the right way to fix it.
2019-07-29 18:05:46 -07:00
Tim Abbott 8c9dd6198f api docs: Use Help Center syntax for restricted endpoints. 2019-07-29 16:17:54 -07:00
Hemanth V. Alluri c85640d6b1 docs: Fix cURL example in get-user-groups.md.
The issue here was that the endpoint was documented as being
contactable by bots when in reality we have a require_member_or_admin
decorator on the endpoint. So bots and guests cannot contact it.
2019-07-29 16:09:11 -07:00
Hemanth V. Alluri b2a3d289b0 docs: Fix cURL example in get-stream-id.md by adding a missing '\'. 2019-07-29 16:07:58 -07:00
Hemanth V. Alluri e9cc69297f docs: Fix cURL example in get-stream-id.md by using the -G argument. 2019-07-29 16:07:58 -07:00
Hemanth V. Alluri 12dce4b940 api_docs/get-messages: Fix the cURL example.
The issue with the previous example was that it sent the data as
POST variables. This corrected example appropriately encodes data
(with URL encoding) and sends it as GET variables.
2019-07-29 16:07:01 -07:00
Vinit Singh 03180752db compose: Update placeholder text depending on the narrow.
Change the `compose-textarea` placeholder text depending on the
stream/topic or PM recipients that the message will be sent to.

Resolves #12834.
2019-07-29 15:51:50 -07:00
Mateusz Mandera 8f6f78b912 requirements: Upgrade redis from 2.10.6 to 3.2.1.
Fixes #11209.

This requires changing how zadd is used in rate_limiter.py:
In redis-py >= 3.0 the pairs to ZADD need to be passed as a dictionary,
not as *args or **kwargs, as described at
https://pypi.org/project/redis/3.2.1/ in the section
"Upgrading from redis-py 2.X to 3.0".

The rate_limiter change has to be in one commit with the redis upgrade,
because the dict format is not supported before redis-py 3.0.
2019-07-29 15:34:05 -07:00
Wyatt Hoodes ecb1b1a1e1 openapi: Fix typing for self.data. 2019-07-29 15:24:51 -07:00
Wyatt Hoodes 45e37d16c3 corporate/views: Fix typing errors. 2019-07-29 15:23:52 -07:00
Wyatt Hoodes b01ba48369 migration_0060: Remove unreachable return statement.
This was introduced in a past refactoring.
2019-07-29 15:23:34 -07:00
Wyatt Hoodes f22b2c7e9d archive: Fix typing for prev_sender variable.
We know that via the `AbstractMessage` class that `sender`
is of the type `UserProfile`.  We type this as `Optional`
to tell mypy that the operands to the right of the first
`or` can indeed be evaluated within the following `for` loop.
2019-07-29 15:23:10 -07:00
Wyatt Hoodes 99bd55917e zephyr: Fix typing for cred parameter. 2019-07-29 15:23:10 -07:00
Wyatt Hoodes 0834514668 auth: Fix typing for authenticate_remote_user. 2019-07-29 15:23:10 -07:00
Wyatt Hoodes 4149bac696 actions: Fix typing of query_filter. 2019-07-29 15:23:10 -07:00
Wyatt Hoodes 1706e06884 bugdown/init: Fix typing for fence variable. 2019-07-29 15:23:10 -07:00
Wyatt Hoodes 22481f63bf upload: Fix typing for key variable. 2019-07-29 15:23:10 -07:00
Wyatt Hoodes a75abe096b migration_0064: Fix typing for file_key. 2019-07-29 15:23:10 -07:00
Wyatt Hoodes e106f95c8b migration_0064: Remove usage of Text type. 2019-07-29 15:23:10 -07:00
Wyatt Hoodes 8107230b35 domains: Fix typing for validate_domain. 2019-07-29 15:18:24 -07:00
Wyatt Hoodes a109508e34 typing: Remove now-unnecessary conditional import.
As a result of dropping support for trusty, we can remove our old
pattern of putting `if False` before importing the typing module,
which was essential for Python 3.4 support, but not required and maybe
harmful on newer versions.

cron_file_helper
check_rabbitmq_consumers
hash_reqs
check_zephyr_mirror
check_personal_zephyr_mirrors
check_cron_file
zulip_tools
check_postgres_replication_lag
api_test_helpers
purge-old-deployments
setup_venv
node_cache
clean_venv_cache
clean_node_cache
clean_emoji_cache
pg_backup_and_purge
restore-backup
generate_secrets
zulip-ec2-configure-interfaces
diagnose
check_user_zephyr_mirror_liveness
2019-07-29 15:18:22 -07:00
Yashashvi Dave 865a7204f9 custom fields: Set generic click handler on remove_date buttons.
This commit adds click handler on date type custom profile
fields on field initialization itself.
This commit also fixes the bug in date type fields in user
profile in org settings.
2019-07-29 15:06:35 -07:00
Yashashvi Dave b93ca2fc50 custom fields: Hide remove_date button for none value date fields.
This commit adds a click handler on datepicker custom profile
fields, which hides the `remove_date` button if the field value
is not set.

Fixes part of #11453
2019-07-29 15:06:35 -07:00
Yashashvi Dave 2e8cf6984e user settings: Fix click handler errors on datepicker profile field.
On change value click handlers on user profile fields in user settings
were also initialized on profile fields in org settings -> users
section. In org settings -> users, we do not need on change value
click handlers.
This commit fixes above issue by setting up handlers only on
user settings page.
2019-07-29 15:06:35 -07:00
Yashashvi Dave 440975e369 org settings: Fix background color in custom user profile datepicker field.
Fixes part of #11453
2019-07-29 15:06:35 -07:00
Anders Kaseorg b758ed5ac1 nginx: Remove invalid extra headers for OPTIONS /api/v1/events.
Since 204 responses don’t contain a payload body, Content-Type is
neither required nor encouraged (RFC 7231 §3.1.1.5), and ours was
missing a semicolon to boot; Content-Length is expressly
forbidden (RFC 7230 §3.3.2).

Furthermore, these add_header directives were silencing the CORS
headers set in api_headers, because add_header inheritance doesn’t
work the way you think it does, as was known before commit
5614d51afc.

Fixes: #12902.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-29 14:58:35 -07:00
Tim Abbott 934d7c2f0f docs: Fix development version warning.
This was sadly broken by the comment Greg added to document how it
works :(.
2019-07-26 17:29:21 -07:00
Anders Kaseorg e00d4be6d5 events: Check last_event_id for validity.
This verifies that the client passed a last_event_id that actually
came from the queue instead of making up an ID from the future.  It
turns out one of our tests was making up such an ID, but legitimate
clients are expected not to do so.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-26 17:18:28 -07:00
Wyatt Hoodes bbbea9ec87 events: Rewrite system for managing realm exports.
This feature is intended to cover all of our ways of exporting a
realm, not just the initial "public export" feature, so we should name
things appropriately for that goal.

Additionally, we don't want to include data exports in page_params;
the original implementation was actually buggy and would have.
2019-07-26 16:38:52 -07:00
Wyatt Hoodes b1900c406a public_export: Add logic for deleting the export tarball.
The path to the uploaded tarball is reconstructed via the relative url and
removed with the canonical methods in `upload.py`.
2019-07-26 15:52:03 -07:00
Wyatt Hoodes ef02de4834 public_export: Add endpoint for returning all REALM_EXPORTED objects. 2019-07-26 15:52:02 -07:00
Wyatt Hoodes d070f27359 queue_processors: Change the extra_data field to a relative url path.
A better approach as compared to saving the full public url.
2019-07-26 15:50:02 -07:00
Wyatt Hoodes 266ed9ff75 public_export: Add acting_user to RealmAuditLog object.
An acting_user attribute is required to correctly reference who
initiated a realm_exported event.
2019-07-26 15:49:47 -07:00
Tim Abbott 1a7fd33ddb webhooks: Fix typo in a trello error message. 2019-07-26 15:12:45 -07:00
Hemanth V. Alluri ede73ee4cd streams: New stream messages should be auto marked as read by creator.
When a person creates a new realm, they'll likely want to create a
bunch of initial streams at once. When doing so, it could be annoying
to have to mark all of the new stream notification messages as read.

Thus to make this process smoother, we should automatically mark
the messages generated by the Notification Bot in the notifications
(announcements) stream, as well as in the newly created stream itself
as read by the stream creator.

Fixes #12765.
2019-07-26 15:10:09 -07:00
Hemanth V. Alluri 3528c454c0 openapi: Update tests to ensure that request parameter types match.
This commit add an pretty elaborate extension to the existing
openapi documentation validation test: test_openapi_arguments.

This does a metacode analysis, comparing the openapi documentation
with the appropriate function's declaration, default values etc.

While it has some limitations, it is able to catch various common
classes of mistakes in the types declared for our OpenAPI
documentation.
2019-07-26 12:49:59 -07:00
Tim Abbott 866b3566d4 api: Fix OpenAPI type declarations for events_register.
A few fields that are actually arrays were incorrectly declared as
strings.
2019-07-26 12:31:53 -07:00
Aman 2183a74040 zulint: Use zulint from the extracted repository.
zulint will be added as a "third-party" dependency in zulip from now
on.  See the new project at https://github.com/zulip/zulint for more
details.
2019-07-26 11:35:43 -07:00
Vishnu Ks 618d026941 version: Bump PROVISION_VERSION for py packages upgrade. 2019-07-26 10:57:31 -07:00
Vishnu Ks b602cbbb82 requirements: Upgrade defusedxml from 0.5.0 to 0.6.0. 2019-07-26 10:57:31 -07:00
Vishnu Ks cb8b935ee8 requirements: Upgrade certifi from 2019.3.9 to 2019.6.16. 2019-07-26 10:57:31 -07:00
Vishnu Ks 628030b742 requirements: Upgrade wheel from 0.33.1 to 0.33.4. 2019-07-26 10:57:31 -07:00
Vishnu Ks 0b9b9e5673 requirements: Upgrade pip from 19.1 to 19.2.1. 2019-07-26 10:57:31 -07:00
Vishnu Ks 3ebffe06bf requirements: Upgrade tblib from 1.3.2 to 1.4.0. 2019-07-26 10:57:31 -07:00
Vishnu Ks 096244a783 requirements: Upgrade snakeviz from 2.0.0 to 2.0.1. 2019-07-26 10:57:31 -07:00
Vishnu Ks 5c4fcf809a requirements: Upgrade Scrapy from 1.6.0 to 1.7.2. 2019-07-26 10:57:31 -07:00
Vishnu Ks f6791b30af requirements: Upgrade moto from 1.3.7 to 1.3.13. 2019-07-26 10:57:31 -07:00
Vishnu Ks dccb41fa47 requirements: Upgrade isort from 4.3.17 to 4.3.21. 2019-07-26 10:57:31 -07:00
Vishnu Ks 4f6d6ff9e1 requirements: Upgrade gitlint from 0.11.0 to 0.12.0. 2019-07-26 10:57:31 -07:00
Vishnu Ks 9487539930 requirements: Upgrade twilio from 6.26.2 to 6.29.2. 2019-07-26 10:57:31 -07:00