Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 8c201c9

Browse files
committed
Merge tag 'v1.39.0rc3' into develop
Synapse 1.39.0rc3 (2021-07-28) ============================== Bugfixes -------- - Fix a bug introduced in Synapse 1.38 which caused an exception at startup when SAML authentication was enabled. ([\#10477](#10477)) - Fix a long-standing bug where Synapse would not inform clients that a device had exhausted its one-time-key pool, potentially causing problems decrypting events. ([\#10485](#10485)) - Fix reporting old R30 stats as R30v2 stats. Introduced in v1.39.0rc1. ([\#10486](#10486)) Internal Changes ---------------- - Fix an error which prevented the Github Actions workflow to build the docker images from running. ([\#10461](#10461)) - Fix release script to correctly version debian changelog when doing RCs. ([\#10465](#10465))
2 parents d9cb658 + 2254e67 commit 8c201c9

File tree

11 files changed

+81
-17
lines changed

11 files changed

+81
-17
lines changed

CHANGES.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
Synapse 1.39.0rc3 (2021-07-28)
2+
==============================
3+
4+
Bugfixes
5+
--------
6+
7+
- Fix a bug introduced in Synapse 1.38 which caused an exception at startup when SAML authentication was enabled. ([\#10477](https://github.com/matrix-org/synapse/issues/10477))
8+
- Fix a long-standing bug where Synapse would not inform clients that a device had exhausted its one-time-key pool, potentially causing problems decrypting events. ([\#10485](https://github.com/matrix-org/synapse/issues/10485))
9+
- Fix reporting old R30 stats as R30v2 stats. Introduced in v1.39.0rc1. ([\#10486](https://github.com/matrix-org/synapse/issues/10486))
10+
11+
12+
Internal Changes
13+
----------------
14+
15+
- Fix an error which prevented the Github Actions workflow to build the docker images from running. ([\#10461](https://github.com/matrix-org/synapse/issues/10461))
16+
- Fix release script to correctly version debian changelog when doing RCs. ([\#10465](https://github.com/matrix-org/synapse/issues/10465))
17+
18+
119
Synapse 1.39.0rc2 (2021-07-22)
220
==============================
321

changelog.d/10461.misc

Lines changed: 0 additions & 1 deletion
This file was deleted.

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ matrix-synapse-py3 (1.39.0ubuntu1) UNRELEASED; urgency=medium
44

55
-- Richard van der Hoff <[email protected]> Tue, 20 Jul 2021 00:10:03 +0100
66

7+
matrix-synapse-py3 (1.39.0~rc3) stable; urgency=medium
8+
9+
* New synapse release 1.39.0~rc3.
10+
11+
-- Synapse Packaging team <[email protected]> Wed, 28 Jul 2021 13:30:58 +0100
12+
713
matrix-synapse-py3 (1.38.1) stable; urgency=medium
814

915
* New synapse release 1.38.1.

scripts-dev/release.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ def run():
139139

140140
# Switch to the release branch.
141141
parsed_new_version = version.parse(new_version)
142+
143+
# We assume for debian changelogs that we only do RCs or full releases.
144+
assert not parsed_new_version.is_devrelease
145+
assert not parsed_new_version.is_postrelease
146+
142147
release_branch_name = (
143148
f"release-v{parsed_new_version.major}.{parsed_new_version.minor}"
144149
)
@@ -190,12 +195,21 @@ def run():
190195
# Generate changelogs
191196
subprocess.run("python3 -m towncrier", shell=True)
192197

193-
# Generate debian changelogs if its not an RC.
194-
if not rc:
195-
subprocess.run(
196-
f'dch -M -v {new_version} "New synapse release {new_version}."', shell=True
197-
)
198-
subprocess.run('dch -M -r -D stable ""', shell=True)
198+
# Generate debian changelogs
199+
if parsed_new_version.pre is not None:
200+
# If this is an RC then we need to coerce the version string to match
201+
# Debian norms, e.g. 1.39.0rc2 gets converted to 1.39.0~rc2.
202+
base_ver = parsed_new_version.base_version
203+
pre_type, pre_num = parsed_new_version.pre
204+
debian_version = f"{base_ver}~{pre_type}{pre_num}"
205+
else:
206+
debian_version = new_version
207+
208+
subprocess.run(
209+
f'dch -M -v {debian_version} "New synapse release {debian_version}."',
210+
shell=True,
211+
)
212+
subprocess.run('dch -M -r -D stable ""', shell=True)
199213

200214
# Show the user the changes and ask if they want to edit the change log.
201215
repo.git.add("-u")

synapse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
except ImportError:
4848
pass
4949

50-
__version__ = "1.39.0rc2"
50+
__version__ = "1.39.0rc3"
5151

5252
if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)):
5353
# We import here so that we don't have to install a bunch of deps when

synapse/api/constants.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ class ToDeviceEventTypes:
128128
RoomKeyRequest = "m.room_key_request"
129129

130130

131+
class DeviceKeyAlgorithms:
132+
"""Spec'd algorithms for the generation of per-device keys"""
133+
134+
ED25519 = "ed25519"
135+
CURVE25519 = "curve25519"
136+
SIGNED_CURVE25519 = "signed_curve25519"
137+
138+
131139
class EduTypes:
132140
Presence = "m.presence"
133141

synapse/app/phone_stats_home.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ async def phone_stats_home(hs, stats, stats_process=_stats_process):
109109
for name, count in r30_results.items():
110110
stats["r30_users_" + name] = count
111111

112-
r30v2_results = await store.count_r30_users()
112+
r30v2_results = await store.count_r30v2_users()
113113
for name, count in r30v2_results.items():
114114
stats["r30v2_users_" + name] = count
115115

synapse/handlers/_base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
import logging
1616
from typing import TYPE_CHECKING, Optional
1717

18-
import synapse.state
19-
import synapse.storage
2018
import synapse.types
2119
from synapse.api.constants import EventTypes, Membership
2220
from synapse.api.ratelimiting import Ratelimiter

synapse/handlers/sync.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,10 @@ async def generate_sync_result(
10931093
one_time_key_counts: JsonDict = {}
10941094
unused_fallback_key_types: List[str] = []
10951095
if device_id:
1096+
# TODO: We should have a way to let clients differentiate between the states of:
1097+
# * no change in OTK count since the provided since token
1098+
# * the server has zero OTKs left for this device
1099+
# Spec issue: https://github.com/matrix-org/matrix-doc/issues/3298
10961100
one_time_key_counts = await self.store.count_e2e_one_time_keys(
10971101
user_id, device_id
10981102
)

synapse/storage/databases/main/end_to_end_keys.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from twisted.enterprise.adbapi import Connection
2323

24+
from synapse.api.constants import DeviceKeyAlgorithms
2425
from synapse.logging.opentracing import log_kv, set_tag, trace
2526
from synapse.storage._base import SQLBaseStore, db_to_json
2627
from synapse.storage.database import DatabasePool, make_in_list_sql_clause
@@ -381,9 +382,15 @@ def _count_e2e_one_time_keys(txn):
381382
" GROUP BY algorithm"
382383
)
383384
txn.execute(sql, (user_id, device_id))
384-
result = {}
385+
386+
# Initially set the key count to 0. This ensures that the client will always
387+
# receive *some count*, even if it's 0.
388+
result = {DeviceKeyAlgorithms.SIGNED_CURVE25519: 0}
389+
390+
# Override entries with the count of any keys we pulled from the database
385391
for algorithm, key_count in txn:
386392
result[algorithm] = key_count
393+
387394
return result
388395

389396
return await self.db_pool.runInteraction(

0 commit comments

Comments
 (0)