Compare commits

..

2 Commits
2.1.7 ... 2.1.8

Author SHA1 Message Date
Alex Vandiver
3819a376b5 Release Zulip Server 2.1.8. 2021-08-12 00:25:29 +00:00
Iam-VM
6749817f3e migrations: Fix possible 0257_fix_has_link_attribute.py failure.
While it should be an invariant that message.rendered_content is never
None for a row saved to the database, it is possible for that
invariant to be violated, likely including due to bugs in previous
versions of data import/export tools.

While it'd be ideal for such messages to be rendered to fix the
invariant, it doesn't make sense for this has_link migration to crash
because of such a corrupted row, so we apply the similar policy we
already have for rendered_content="".
2021-08-04 12:48:15 -07:00
3 changed files with 9 additions and 4 deletions

View File

@@ -7,6 +7,11 @@ All notable changes to the Zulip server are documented in this file.
This section lists notable unreleased changes; it is generally updated
in bursts.
### 2.1.8 -- 2021-08-11
- Fixed possible `0257_fix_has_link_attribute.py` database migration
failure, which would cause errors during the upgrade process.
### 2.1.7 -- 2020-06-25
- CVE-2020-15070: Fix privilege escalation vulnerability with custom

View File

@@ -1,6 +1,6 @@
import os
ZULIP_VERSION = "2.1.7"
ZULIP_VERSION = "2.1.8"
# Add information on number of commits and commit hash to version, if available
zulip_git_version_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'zulip-git-version')
if os.path.exists(zulip_git_version_file):
@@ -10,7 +10,7 @@ if os.path.exists(zulip_git_version_file):
ZULIP_VERSION = version
LATEST_MAJOR_VERSION = "2.1"
LATEST_RELEASE_VERSION = "2.1.7"
LATEST_RELEASE_VERSION = "2.1.8"
LATEST_RELEASE_ANNOUNCEMENT = "https://blog.zulip.org/2019/12/13/zulip-2-1-released/"
# Versions of the desktop app below DESKTOP_MINIMUM_VERSION will be

View File

@@ -13,9 +13,9 @@ BATCH_SIZE = 1000
def process_batch(apps: StateApps, id_start: int, id_end: int, last_id: int) -> None:
Message = apps.get_model('zerver', 'Message')
for message in Message.objects.filter(id__gte=id_start, id__lte=id_end).order_by("id"):
if message.rendered_content == "":
if message.rendered_content in ["", None]:
# There have been bugs in the past that made it possible
# for a message to have "" as its rendered_content; we
# for a message to have "" or None as its rendered_content; we
# need to skip those because lxml won't process them.
#
# They should safely already have the correct state