Commit Graph

32173 Commits

Author SHA1 Message Date
Vaibhav 9f5b1f19e9 css: Use SCSS nesting in alerts.scss for `.alert`. 2019-06-06 11:41:35 -07:00
Tim Abbott 065575debf retention: Add a quick comment explaining how deletion works. 2019-06-06 11:41:07 -07:00
Mateusz Mandera 323be57151 retention: If stream has no retention policy set, use realm policy.
We add the following behavior:
If stream has message_retention_days set to -1, archiving for it is
disabled.
If stream has message_retention_days set to null, use the realm's
policy. If the realm has no policy, we don't archive for this stream.
2019-06-06 11:17:42 -07:00
Mateusz Mandera 8bef82c7f9 retention: Clean up redundant code for special handling of UserMessages.
UserMessages no longer need special handling, they can be archived by
move_models_with_message_key_to_archive and automatically cleaned up
like the other models with a message key with CASCADING=True.
2019-06-06 11:17:42 -07:00
Mateusz Mandera 0e9fa4f028 retention: Support stream-based retention policies.
We change the archiving scheme to allow having stream based retention
policies. In the first step of the archiving process, we loop over
streams and archive their expired messages and related objects.
Then we separately archive all expired personal and huddle messages and
related objects. As the last step, we scan for redundant attachments
which can now be deleted.
To achieve this, we have to rewrite a significant portion of the
retention code and rework some of the database queries.
For the sake of simplicity, we neither archive nor delete cross-realm
messages, except cross-realm stream messages – in their case they can
be processed in the same manner as ordinary stream messages.
In the query for archiving personal and huddle messages we simply
exclude those sent by cross-realm bots.
We change the tests to adapt to these modifications.
2019-06-06 11:17:42 -07:00
Mateusz Mandera aa45325b5f retention: Rename move_expired_rows to move_rows. 2019-06-06 11:17:42 -07:00
Mateusz Mandera d481ee9a40 retention: Add message_retention_days field to Stream model. 2019-06-06 11:17:42 -07:00
Mateusz Mandera d373a16910 retention: Remove realm_id check when archiving attachments.
Since we archive attachments and attachment_messages tied to a list of
ids of Messages that we just archived (so from the current realm), it's
unnecessary to check their realm in the queries. This could potentially
cause archiving of an attachment with realm_id of another realm, but
this isn't an issue, as long as we make sure we don't end up deleting
the original Attachment object incorrectly - but realm_id check is
included in delete_expired_attachments() to ensure that.
2019-06-06 11:17:42 -07:00
Rishi Gupta bbf6dc5427 user docs: Fix fake email in restrict-visibility-of-email-addresses.
Fixes regression from 2ff969c.
2019-06-05 17:55:37 -07:00
Thomas Ip c6cdcd082e dependencies: Upgrade node to 12.3.1.
API changes:
* The behaviour of Date.toLocaleTimeString() reverts to pre 8.0.0,
  this only affects automated tests. Lots of other API changes but
  we didn't use any of those.
* The internal sorting algorithm changed which causes one of our own
  compare function to miss coverage.
2019-06-05 17:15:52 -07:00
Vaibhav af5d3769a7 css: Nest `.hotspot-popover` arrows inside `.hotspot.overlay`.
No changes were required in night mode since the night-mode css
already includes the same level of nesting.
Tested visually as well.
2019-06-05 17:08:59 -07:00
Vaibhav 4c41bc1324 css: Use SCSS nesting in hotspots.scss for `.hotspot-popover`. 2019-06-05 17:08:59 -07:00
Vaibhav d43548c7ca css: Use SCSS nesting in hotspots.scss for `.hotspot-popover.arrow-*`. 2019-06-05 17:08:59 -07:00
Vaibhav 209b16e667 css: Use SCSS nesting for in hotspots.scss for `.hotspot-confirm`. 2019-06-05 17:08:59 -07:00
Vaibhav 2b6acbfe03 css: Nest hotspot inline elems inside `.hotspot-inline`.
No changes required here for night-mode.
2019-06-05 17:08:59 -07:00
Vaibhav ce34fe51cd css: Use SCSS nesting in hotspots.scss for `.hotspot-inline`. 2019-06-05 17:08:59 -07:00
Vaibhav 9db1a5458d css: Reorder hotspots.scss so `.hotspot-inline` are in same line. 2019-06-05 17:08:59 -07:00
Vaibhav 74e6b5c926 css: Use SCSS nesting in hotspots.scss for `.hotspot.overlay`. 2019-06-05 17:08:59 -07:00
Vaibhav 5f18cc16b7 css: Reorder hotspots.scss so `.hotspots.overlay` are in same place. 2019-06-05 17:08:59 -07:00
Vaibhav 25db1d953d css: Use SCSS nesting in hotspots.scss for `.hotspot-icon`. 2019-06-05 17:08:59 -07:00
Vaibhav e664eb736a css: Reorder hotspots.scss so `.hotspot-icon` are in same place. 2019-06-05 17:08:59 -07:00
Rishi Gupta 3b6969e4c9 docs: Add link to linkedin to summer-with-zulip. 2019-06-05 17:03:24 -07:00
Vishnu Ks 14ed0e283d install: Add option to skip dist-upgrade. 2019-06-05 15:50:02 -07:00
Tim Abbott afb0d1ccce Revert "puppet: Use nice to deprioritize various processes."
This reverts commit d959de7a89.

This broken our Travis CI, so I'm pulling it off while we investigate.
2019-06-05 12:55:56 -07:00
Vaibhav a52c157dd3 css: Add similar nesting to night-mode emoji elements as in reactions.scss.
Due to additional nesting added in reactions.scss, night-mode styles
were prioritized lower than the original rules defined.

Fixes regressions introduced by changes in PR #12473
2019-06-05 12:36:53 -07:00
Tim Abbott d959de7a89 puppet: Use nice to deprioritize various processes.
Our priority hierarchy is:
(1) Tornado and base services like memcached, redis, etc.
(2) Django and message sender queue workers.
(3) Everything else.

Ideally, we'd have something a bit more fine-grained (e.g. some queue
workers are potentially in the sending path, while others aren't), but
this should have a big impact on ensuring Tornado gets the resources
it needs during load spikes.

I think this has a good chance of causing some load spikes that would
previously have resulted in a user-facing delivery delays no longer
having any significant user-facing impact.
2019-06-05 11:56:48 -07:00
Rishi Gupta 2ff969c5a9 user docs: Update restrict-visibility-of-email-addresses.
That we are working to fix the caveats is implied by the (beta) label.

More generally, for /help articles, explanations, apologies, etc can go in a
section at the top, but the rest of the text should be a straightforward
description of the current state.
2019-06-05 11:01:24 -07:00
Rishi Gupta 2556127ae1 help: Remove mark as spam from moderation guide.
We're not sure this feature is the best solution to this category of
problem, in that use of this feature might cause spam to stick around
longer, vs features that encourage immediate deletion.
2019-06-05 10:53:07 -07:00
Tim Abbott 9be3f30340 webpack: Don't import pyinotify in production context.
We only added the dependency for the development environment, but were
imported it unconditionally.
2019-06-04 18:10:58 -07:00
Tim Abbott 3225fd39a5 docs: Split internationalization.md from translation.md.
This provides a better entrypoint for developers to learn about
internationalization in Zulip without cluttering the article for
translators.

I also took the opportunity to add a proper for-developers
introduction, including a link to the very nice EdX guide on the
topic.
2019-06-04 17:35:44 -07:00
Tim Abbott 57a748ad63 node: Remove stream_ui_updates.js from modules expecting coverage.
This module is a UI module, which are harder to test, and in any case,
doesn't actually have any tests.
2019-06-04 16:45:54 -07:00
Priyank Patel 01f8c89294 webpack: Use cache-loader for various loaders.
Profiling shows that using cache-loader saves ~6-7 seconds of time take
by webpack-dev-server on subsequent runs. The overhaul this adds when
nothing is cached (when running first time) is around 1-2 seconds. We don't
use cache loader for ts-loader since webpack docs says it will slow it down
and file-loader since it just copies files over and caching it would just
was disk space.

This is the second merge of this commit.  It fixes the issue with the
previous one by placingn cache-loader after mini-css-loader because it
just extracts css and caching that will make file-loader not run which
in turn makes developement enviorment break.
2019-06-04 16:43:04 -07:00
Vaibhav 25b063ad95 css: Setup `.tab-switcher.allow-overflow` for informational overlays.
This changes the information-overlay tab-switcher to have the class
`.allow-overflow` too.

Fixes a regression introduced in 30da8bdf9b.
2019-06-04 00:43:51 -07:00
Hemanth V. Alluri c6b03432bc docs: modify update-message-flag to contain information about flags.
This makes it a lot more useful for understanding how our flag update
endpoints work.

With significant edits by tabbott to explain what these are.

Fixes #12092.
2019-06-04 00:40:47 -07:00
Tim Abbott fa77467d5d api: Don't allow editing non-editable flags.
Previously, we didn't have validation to prevent editing certain flags
that don't make sense for a client to edit, like whether a user was
mentioned in a given message.

This isn't a security issue -- the user could only mess up their own
personal search results (etc.), but it does seem worth fixing to avoid
confusion for folks developing Zulip clients.

While we're at it, clearly document the situation in comments.
2019-06-04 00:33:21 -07:00
sahil839 5a130097bf settings: Add display setting for demoting inactive streams.
This adds a setting to control Zulip's default behavior of sorting to
bottom and graying out inactive streams.  The previous logic is still
the default "automatic", but this gives users more control.  See the
models.py comment for details.

Fixes #11524.
2019-06-03 23:07:56 -07:00
Tim Abbott 710fc6767f test_fixtures: Fix buggy reuse of migrations_hash path.
We were apparently reusing the path for both the development and test
databases, which meant that we would not always correctly run
`generate_fixtures` when changes were required.

This was a recent regression introduced when we added this cache a few
days ago.
2019-06-03 23:07:56 -07:00
Tim Abbott 5d0e144d62 Revert "webpack: Use cache-loader for various loaders."
This reverts commit eb53b5e8de.

This appeared to not have the right logic yet for handling branch
switches.

See https://chat.zulip.org/#narrow/stream/3-backend/topic/frontend.20hot.20reloading/near/749259 for details.
2019-06-03 22:11:47 -07:00
Priyank Patel 9be6b79945 eslint: Turn off warning from eslint about using unsupported typescript.
We are mostly fine using newer versions of typescript since they
work fine; eslint just warns since it doesn't test against it.
2019-06-03 20:42:58 -07:00
Priyank Patel ceff7e51bd package.json: Remove webpack-cache after installing dependencies.
This is recommended by webpack's cache-loader.
2019-06-03 20:15:51 -07:00
Priyank Patel eb53b5e8de webpack: Use cache-loader for various loaders.
Profiling shows that using cache-loader saves ~6-7 seconds of time take
by webpack-dev-server on subsequent runs. The overhaul this adds when
nothing is cached (when running first time) is around 1-2 seconds. We don't
use cache loader for ts-loader since webpack docs says it will slow it down
and file-loader since it just copies files over and caching it would just
was disk space.

Profiling data:

-------- Master ---------

~/zulip (master) $ tools/webpack --watch | ts -s '%.S' # master
03.995825 ℹ 「wds」: Project is running at http://127.0.0.1:9994/
03.996161 ℹ 「wds」: webpack output is served from /webpack/
03.996289 ℹ 「wds」: Content not from webpack is served from ...
19.284477 ℹ 「wdm」:
19.285371 ℹ 「wdm」: Compiled successfully.

-------- cache-loader ---------

~/zulip (cache-loader)$ tools/webpack --watch | ts -s '%.S'
04.107913 ℹ 「wds」: Project is running at http://127.0.0.1:9994/
04.108646 ℹ 「wds」: webpack output is served from /webpack/
04.109068 ℹ 「wds」: Content not from webpack is served from ...
12.633782 ℹ 「wdm」:
12.634083 ℹ 「wdm」: Compiled successfully.
2019-06-03 20:15:51 -07:00
Priyank Patel 4bb6c29d59 webpack: Use webpack's type defination.
Before we used to defined our own type Loader which was
partly incorrect because the use property can only
be string which is incorrect. We use the RuleSetRule type
provided by webpack instead.
2019-06-03 20:15:51 -07:00
Priyank Patel e590ce95ea dependencies: Add cache-loader for webpack build caching. 2019-06-03 20:15:51 -07:00
Tim Abbott 6236dfab9a docs: Clarify section on local configuration changes.
We still should add a section documenting all the options.
2019-06-03 20:11:07 -07:00
Eeshan Garg 0d519ab146 webhooks/bitbucket2: Account for missing username in user data.
Not all payloads contain the user's username. In such cases, we
should use the user's display name or nickname instead.
2019-06-03 20:00:17 -07:00
YashRE42 1ab4eaf819 stream_list: Pinned streams are never grayed out as inactive.
We have had a longtime bug where the state of pinned streams would not
update properly from the greyed out/inactive state to the active state
when a first message arrived to them.

After some discussion, we determined that likely the right fix for
this is to simply configure pinned streams to never be marked as
inactive; that's more in line with the intended user experience.

Fixes #8201.
2019-06-03 17:23:01 -07:00
Tim Abbott 807e5c7a1a auth: Fix fetching personal API key with email addresses hidden.
This was a corner case missed in the main migration.
2019-06-03 15:55:07 -07:00
Vaibhav 3444691fc1 css: Nest elems inside `.emoji-info-popover`.
These include:
* `.emoji-showcase-container`
* `.emoji-popover`
2019-06-03 15:30:51 -07:00
Vaibhav c6071c0d7a css: Reorder so that elems inside emoji info popover are together. 2019-06-03 15:30:51 -07:00
Vaibhav 14a850dcb4 css: Nest elements inside `.emoji-popover`.
These include:
* `.emoji-popover-top`
* `.emoji-popover-category-tabs`
* `.emoji-popover-emoji-map`
* `.emoji-search-results-container`
* `.emoji-popover-emoji`
2019-06-03 15:30:51 -07:00