Commit Graph

36325 Commits

Author SHA1 Message Date
Alex Vandiver 9800392beb docs: Be more explicit about good prefetching patterns.
The problem is not the list comprehension, as the previous wording
implied, but rather the fact that data is needed from the linked
table.

Be explicit about _what_ in the QuerySet API is helpful for addressing
this -- namely, use of `select_related`.
2020-05-19 14:05:20 -07:00
Siddharth Varshney 0af2f9d838 popover: Hide color palette.
Change in stream color occurs very rarely, and the palette is taking a lot of space in the popover.

This commit will hide the palette in default view of stream popover.
2020-05-19 14:03:35 -07:00
Siddharth Varshney 2c5275839b popover: Change the divider color in `Choose custom color`.
Changed the divider color in to match the style of day/night mode.
2020-05-19 14:03:35 -07:00
Siddharth Varshney ef8050bde0 popover: Use zulip style for `Choose` button.
This commit will change the style of `Choose` btn in both
day and night mode to match with the style of other buttons of the app.
2020-05-19 14:03:35 -07:00
Siddharth Varshney 976016a8fc popover: Add icon for `Custom color picker`. 2020-05-19 14:03:35 -07:00
sahil839 9b78a73e36 populate_db: Add new admin user as 'Desdemona'.
This commit adds a second admin user named 'Desdemona' to dev and
test database.
2020-05-19 11:42:27 -07:00
sahil839 36dca5ba5c analytics: Add order_by to query used for fetching admin emails.
This commit adds order_by to the query that fetches admin emails
in views.py. This is added to show emails alphabetically in case
of multiple admins.
2020-05-19 11:42:27 -07:00
Tim Abbott 9b9aa23f6a docs: Fix path for API code markdown extension. 2020-05-19 11:11:41 -07:00
Tim Abbott b746e0220b narrow: Add a block comment for narrow.activate. 2020-05-19 10:47:52 -07:00
Aman Agrawal 2a4c62a326 update_to_dict_cache: Use bulk queries when preparing msgs for cache.
During events such as stream / topic name edit for a topic, we were
running queries to db in loop for each message for reactions,
submessages and realm_id. This commit reduces the queries to be
done only for realm_id, which is yet to be fixed.

This is accomplished by building messages with empty reactions
and submessages and then updating them in the messages using bulk
queries.
2020-05-19 10:30:03 -07:00
Aman Agrawal b8fe6245e3 message: Extract method to sew submessages and reactions to msg. 2020-05-19 10:30:03 -07:00
Aman Agrawal 21acc65489 test_messages: Test number of queries performed by `to_dict_uncached`.
`to_dict_uncached` performs queries to db in a loop which should be
replaced with bulk db queries.
2020-05-19 10:30:03 -07:00
Steve Howell d526b08ea9 stripe tests: Add back out-of-realm users.
This fixes a minor regression in a very recent
commit.

In 7ad5bea3e6 I was
a little too aggressive about deactivating users.
We do want a few users who are outside the realm,
just to prevent regressions where we fail to filter
on realm.  The likelihood of such regressions are
fairly low, but it would certainly be an ugly bug.
2020-05-18 20:02:19 -04:00
Rohitt Vashishtha c70eb8b772 settings_bots: Do not destroy section when switching to users section.
We were destroying the bots table in start_data_load() which is now
only called for the users section since the refactoring done in
5c16bb9c99.
2020-05-18 17:02:00 -04:00
Steve Howell 7ad5bea3e6 stripe tests: Set the active users explicitly.
Without this change, you could get obscure
failures when logging in as Cordelia if you
modified test data by doing something
fairly innocuous like adding a new test user.

Also the complicated query here to exclude
users was flaky, since it didn't explicitly
order by any field before doing the 'LIMIT 6'.

Part of the problem with debugging this flake
was that the failure would happen for the login,
but the data actually gets changed in `setUp,
which is easy to overlook, since it's not
explicitly invoked.

We continue to keep the seat_count set to
a constant, predictable value, since some
tests are very sensitive to having 6 users.
2020-05-18 15:37:39 -04:00
YashRE42 01deb8a6af navbar: Use direct child selector to target spans.
The navbar uses rendered markdown and rendered html within the narrow
description, this inserts eg katex--html and allows rendering of
inline math formulae. Unfortunately, in the previous SCSS file, this
fact was overlooked and a generic "span" selector was used with would
target all spans within the parent element, direct descendants or
otherwise, which caused the side effect of applying padding and margin
to inner katex elements which broke appearance.

This commit replaces the "span" selector with "& > span" so that only
spans which are the direct children to the parent element are selected
and katex--html is rendered correctly.

Fixes: #14947.
2020-05-17 21:45:28 -07:00
Steve Howell ca0b8fd4b3 docs: Downplay actions.py a bit. 2020-05-17 21:32:38 -07:00
Steve Howell 2da81d9ab5 docs: Explain we don't use nginx in dev. 2020-05-17 21:29:28 -07:00
Steve Howell c8ce12bdd0 docs: Add missing comma. 2020-05-17 21:27:31 -07:00
Steve Howell c4208bf39b docs: Use modern stream narrow urls. 2020-05-17 21:27:31 -07:00
Steve Howell 86c3ba26ff docs: Update tornado line count. 2020-05-17 21:27:30 -07:00
Steve Howell 3cda5b61b1 docs: List four types of emojis. 2020-05-17 21:26:56 -07:00
Steve Howell 792e28056e docs: Use 5 seconds as our bar for null provisions. 2020-05-17 21:25:53 -07:00
Steve Howell c1dc7b99ea docs: Put backticks around `SourceMap`. 2020-05-17 21:25:53 -07:00
Steve Howell cdeeffb44b docs: Replace "fancy" with longstanding. 2020-05-17 21:25:53 -07:00
Steve Howell 6c4a471cc2 docs: Word cautioning advice more directly. 2020-05-17 21:25:53 -07:00
Steve Howell 23c2198da3 docs: Use string_id in header. 2020-05-17 21:25:53 -07:00
Steve Howell 35df5f35d8 docs: Keep manual-restore steps sequential. 2020-05-17 21:25:53 -07:00
Steve Howell 0267e5b145 docs: Mention zilencer in context.
We mention zilencer later in the docs, but I think it's
important to mention it specifically in the context of
management commands, too.
2020-05-17 21:25:53 -07:00
Steve Howell f8606eb68a docs: Alphabetize glossary. 2020-05-17 21:25:53 -07:00
Steve Howell 0b3d14a408 docs: Remove alpha status for ZulipTerminal. 2020-05-17 07:56:38 -04:00
Steve Howell b3c9676baf docs: Use full path for zulip.yaml.
Note that this section may actually be obsolete.
2020-05-17 07:56:38 -04:00
Steve Howell cc9e6a54c0 doc: Fix tense for "Include". 2020-05-17 07:56:38 -04:00
Siddharth Varshney 2981938817 ui: Change width of divider in setting menu.
This will now matche with the other popover `hrule` width.
2020-05-16 15:42:26 -07:00
Hemanth V. Alluri c8f4177872 webhooks/github: Add a support for team/edited events.
Signed-off-by: Hemanth V. Alluri <hdrive1999@gmail.com>
2020-05-16 14:59:08 -07:00
sahil839 46ef6816b6 stream: Allow non admins to set stream post policy when creating streams.
This commit allows non admins to set stream post policy while creating
streams.

Restriction was there to prevent user from creating a stream in which
the user cannot post himself but this will be taken care of with
stream admin feature.
2020-05-16 14:53:22 -07:00
Vishnu Ks 66b1ad7002 billing: User FREE_TRIAL_DAYS instead of FREE_TRIAL_MONTHS. 2020-05-16 14:52:01 -07:00
Rohitt Vashishtha 6528226a80 dropdown_list_widget: Add basic tests. 2020-05-16 14:51:19 -07:00
Rohitt Vashishtha c76648c3d4 zjquery: Do not run JSON.parse on data-* attrs.
JSON.parse behaves as we want for numbers but for strings, we would
throw an error like 'unexpected token at position 0'. This meant we
couldn't read back the value set by `$input.data('val', 'text')`.
2020-05-16 14:51:19 -07:00
Rohitt Vashishtha a6a1858272 dispatch: Replace broken call to settings_org.
We had removed this function from the codebase when we switched to
using dropdown_list_widget. This was accidentally left as it is when
making that change.
2020-05-16 14:51:19 -07:00
Aman Agrawal 40c2a82e4e
message_events: Update edited msgs to be rerendered together.
This significantly reduces the time required to handle events like
stream & topic name edit for topics.

Verified using the Chrome Profiler for a topic with 100 messages:
With this commit: 0.64s to move the topic to a different stream.
Without this commit: 5.5s.
2020-05-16 14:48:44 -07:00
Mateusz Mandera b234fe8ccb retention: Pass optional realm argument to move_messages_to_archive.
This allows having the realm field of ArchiveTransaction set instead of
NULL when using move_messages_to_archive.
2020-05-16 14:46:56 -07:00
Kartik Srivastava 112f539034 openapi/python_examples: Update update_user example.
This updates the `update_user` example to use `update_user_by_id`.
2020-05-16 14:45:47 -07:00
Kartik Srivastava d2ab5673fd openapi/python_examples: Update deactivate_user example.
This updates the `deactivate_user` example to use
`deactivate_user_by_id`.
2020-05-16 14:45:47 -07:00
Mateusz Mandera 7d8a3581a5 retention: Clarify the status of cross-realm huddles in a comment. 2020-05-16 14:42:40 -07:00
Aman Agrawal 4f8c28311e mailmap: Add mailmap entry for Aman Agrawal. 2020-05-15 17:11:19 -07:00
Tim Abbott f10f2600e0 retention: Fix OOM issues when deleting large numbers of transactions.
For unknown reasons, deleting 10,000s of ArchiveTransaction objects
results in rapidly growing memory in the job making the request in the
Django process, eventually leading to an OOM kill.

I don't understand why Django behaves that way; I would have expected
the failure mode to instead be a serious load problem on the database
server, but perhaps the way Django's internal deletion logic handles
cascading the deletes to many millions of ArchiveMessages and other
ForeignKey objects requires tracking a lot of data in memory.

The solution is the same in any case, which is to batch the deletions
to execute a reasonable number of them at once.  Doing a single
ArchiveTransaction at a time would likely result in huge numbers of
database queries in a loop, which performs very poorly.  So we balance
by batching deletions in groups of 100 ArchiveTransactions; testing
this in production, I saw no spike of memory usage materially beyond
that of a normal Django process, and each bulk-deletion transaction
takes several seconds to process (meaning per-transaction overhead is
negligible).
2020-05-15 17:10:19 -07:00
Vishnu KS 95bf133701 mailmap: Add .mailmap entry for Brock Whittaker. 2020-05-15 17:09:54 -07:00
Vishnu KS 60dcfb821e mailmap: Add .mailmap entry for Vishnu KS. 2020-05-15 17:09:54 -07:00
Tim Abbott c43b3d95e2 puppet: Switch env-wal-e to use wal-g rather than wal-e.
wal-g is the modern reimplementation of wal-e that supports current
postgres.  It requires a bit of extra configuration to specify the AWS
region.
2020-05-15 16:45:36 -07:00