Zulip 服务器和 Web 应用程序。开源团队聊天可帮助团队保持高效和专注。
Go to file
Alex Vandiver 9d97af6ebb scheduled_email: Create ScheduledEmail objects in a transaction.
This fixes two bugs: the most obvious is that there is a race where a
ScheduledEmail object could be observed in the window between creation
and when users are added; this is a momentary instance when the object
has no users, but one that will resolve itself.

The more subtle is that .save() will, if no records were found to be
updated, _re-create_ the object as it exists in memory, using an
INSERT[1].  Thus, there is a race with `deliver_scheduled_emails`
between when the users are added, and when `email.save()` runs:

 1. Web request creates ScheduledEmail object
 2. Web request creates ScheduledEmailUsers object
 3. deliver_scheduled_emails locks the former, preventing updates.
 4. deliver_scheduled_emails deletes both objects, commits, releasing lock
 5. Web request calls `email.save()`; UPDATE finds no rows, so it
    re-creates the ScheduledEmail object.
 6. Future deliver_scheduled_emails runs find a ScheduledEmail with no
    attending ScheduledEmailUsers objects

Wrapping the logical creation of both of these in a single transaction
avoids both of these races.

[1] https://docs.djangoproject.com/en/3.2/ref/models/instances/#how-django-knows-to-update-vs-insert
2021-08-17 18:35:25 +00:00
.github ci: Do not run CodeQL on Dependabot push events. 2021-08-04 02:34:21 -07:00
.tx cleanup: Delete trailing newlines. 2019-08-06 23:29:11 -07:00
analytics support: Remove is True in comparisons. 2021-08-10 12:08:13 -07:00
confirmation confirmation: Use the correct type hints for create_confirmation_link. 2021-07-26 14:46:45 -07:00
corporate billing: Refactor initial_upgrade to use REQ. 2021-08-08 17:11:18 -07:00
docs changelog: Add 2.1.8 release notes. 2021-08-12 01:06:15 +00:00
frontend_tests node_tests: Fix incorrect usage of assert.throws. 2021-08-10 13:18:53 -07:00
locale i18n: Update translation data from Transifex. 2021-07-15 09:15:35 -07:00
pgroonga pgroonga: Remove unnecessary code from first migration. 2021-05-28 09:42:33 -07:00
puppet mypy: Add types-psycopg2. 2021-08-09 20:32:19 -07:00
requirements mypy: Add boto3-stubs. 2021-08-09 20:32:19 -07:00
scripts restart-server: Add a --skip-tornado. 2021-08-04 10:57:53 -07:00
static landing-page: Fix mobile scrolling bug when sidebar is toggled. 2021-08-17 06:23:46 -07:00
stubs stripe: Upgrade stripe API to 2020-08-27 version. 2021-07-23 21:44:41 -07:00
templates data_import: Import custom emoji from Rocket.Chat. 2021-08-09 06:38:26 -07:00
tools generate_integration_bots_avatars: Fix transparency initialization. 2021-08-09 20:32:19 -07:00
var/puppeteer puppeteer_tests: Port to TypeScript. 2021-02-22 16:03:10 -08:00
zerver scheduled_email: Create ScheduledEmail objects in a transaction. 2021-08-17 18:35:25 +00:00
zilencer python: Convert "".format to Python 3.6 f-strings. 2021-08-02 15:53:52 -07:00
zproject rate_limit: Rate limit the /accounts/find/ endpoint. 2021-08-06 12:17:44 +02:00
.browserslistrc browserslist: Drop 0.2% usage threshold to 0.15%. 2020-09-28 10:57:49 -07:00
.codecov.yml codecov: Change threshold to use percentage syntax. 2019-07-20 14:37:04 -07:00
.editorconfig lint: Add shfmt as a linter. 2020-10-15 15:16:00 -07:00
.eslintignore requirements: Remove Thumbor. 2021-05-06 20:07:32 -07:00
.eslintrc.json ts: Convert blueslip module to TypeScript. 2021-06-22 09:09:36 -07:00
.gitattributes
.gitignore ci: Update outdated comments, documentation and gitignore. 2021-07-22 14:09:01 -07:00
.gitlint lint: Re-enable imperative-mood checking. 2021-02-23 14:54:07 -08:00
.mailmap mailmap: Add mailmap entry for Sahil Batra. 2021-07-21 10:46:34 -07:00
.npmignore
.prettierignore lint: Use Prettier for JSON files. 2020-07-24 09:42:56 -07:00
.pyre_configuration pysa: Update .pyre_configuration to point to typeshed. 2020-09-22 15:44:47 -07:00
.sonarcloud.properties tools: Configure Zulip to be scannable by SonarCloud. 2020-06-24 12:41:17 -07:00
.yarnrc .yarnrc: Set ignore-scripts true. 2019-08-28 16:15:54 -07:00
babel.config.js i18n: Initialize FormatJS. 2021-04-13 17:41:10 -07:00
CODE_OF_CONDUCT.md docs: Remove dead link to citizencodeofconduct.org. 2021-04-09 12:10:42 -07:00
CONTRIBUTING.md docs: Replace chat-zulip-org page with /developer-community/. 2021-07-25 22:17:57 -07:00
Dockerfile-postgresql docs: Standardize on PostgreSQL, not Postgres. 2020-10-28 11:55:16 -07:00
LICENSE license: Move copyright notice from LICENSE to NOTICE. 2021-02-05 09:28:12 -08:00
manage.py manage: Restore changepassword back to documented_commands. 2021-06-18 09:11:01 -07:00
NOTICE docs: Bump copyright year. 2021-02-05 09:28:15 -08:00
package.json dependencies: Upgrade JavaScript dependencies. 2021-07-14 16:47:00 -07:00
postcss.config.js eslint: Fix import/extensions. 2021-06-08 10:15:52 -07:00
prettier.config.js casper: Remove few traces of casper. 2020-08-30 17:16:02 -07:00
pyproject.toml mypy: Add boto3-stubs. 2021-08-09 20:32:19 -07:00
README.md docs: Replace chat-zulip-org page with /developer-community/. 2021-07-25 22:17:57 -07:00
SECURITY.md docs: Replace legacy roadmap.md with release lifecycle page. 2021-05-05 09:08:43 -07:00
setup.cfg pycodestyle: Improve comments documenting excludes. 2021-02-12 13:11:25 -08:00
stylelint.config.js portico: Add /for/education, /for/events, /for/research pages. 2021-07-20 22:37:52 -07:00
tsconfig.json ts: Convert i18n module to TypeScript. 2021-06-22 09:09:36 -07:00
Vagrantfile shell: Replace ‘which’ utility with ‘command -v’ shell builtin. 2021-05-07 08:54:41 -07:00
version.py mypy: Add boto3-stubs. 2021-08-09 20:32:19 -07:00
webpack.config.ts webpack: Fix run-dev.py --minify. 2021-06-10 17:26:55 -07:00
yarn.lock dependencies: Upgrade JavaScript dependencies. 2021-07-14 16:47:00 -07:00

Zulip overview

Zulip is a powerful, open source group chat application that combines the immediacy of real-time chat with the productivity benefits of threaded conversations. Zulip is used by open source projects, Fortune 500 companies, large standards bodies, and others who need a real-time chat system that allows users to easily process hundreds or thousands of messages a day. With over 700 contributors merging over 500 commits a month, Zulip is also the largest and fastest growing open source group chat project.

GitHub Actions build status coverage status Mypy coverage code style: black code style: prettier GitHub release docs Zulip chat Twitter GitHub Sponsors

Getting started

Click on the appropriate link below. If nothing seems to apply, join us on the Zulip community server and tell us what's up!

You might be interested in:

You may also be interested in reading our blog or following us on Twitter. Zulip is distributed under the Apache 2.0 license.