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

Commit 6180e1b

Browse files
committed
Merge tag 'v1.62.0rc3' into develop
Synapse 1.62.0rc3 (2022-07-04) ============================== Bugfixes -------- - Update the version of the [ldap3 plugin](https://github.com/matrix-org/matrix-synapse-ldap3/) included in the `matrixdotorg/synapse` DockerHub images and the Debian packages hosted on `packages.matrix.org` to 0.2.1. This fixes [a bug](matrix-org/matrix-synapse-ldap3#163) with usernames containing uppercase characters. ([\#13156](#13156)) - Fix a bug introduced in Synapse 1.62.0rc1 affecting unread counts for users on small servers. ([\#13168](#13168))
2 parents 9820665 + 95a260d commit 6180e1b

File tree

6 files changed

+33
-12
lines changed

6 files changed

+33
-12
lines changed

CHANGES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
Synapse 1.62.0rc3 (2022-07-04)
2+
==============================
3+
4+
Bugfixes
5+
--------
6+
7+
- Update the version of the [ldap3 plugin](https://github.com/matrix-org/matrix-synapse-ldap3/) included in the `matrixdotorg/synapse` DockerHub images and the Debian packages hosted on `packages.matrix.org` to 0.2.1. This fixes [a bug](https://github.com/matrix-org/matrix-synapse-ldap3/pull/163) with usernames containing uppercase characters. ([\#13156](https://github.com/matrix-org/synapse/issues/13156))
8+
- Fix a bug introduced in Synapse 1.62.0rc1 affecting unread counts for users on small servers. ([\#13168](https://github.com/matrix-org/synapse/issues/13168))
9+
10+
111
Synapse 1.62.0rc2 (2022-07-01)
212
==============================
313

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
matrix-synapse-py3 (1.62.0~rc3) stable; urgency=medium
2+
3+
* New Synapse release 1.62.0rc3.
4+
5+
-- Synapse Packaging team <[email protected]> Mon, 04 Jul 2022 16:07:01 +0100
6+
17
matrix-synapse-py3 (1.62.0~rc2) stable; urgency=medium
28

39
* New Synapse release 1.62.0rc2.

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ skip_gitignore = true
5454

5555
[tool.poetry]
5656
name = "matrix-synapse"
57-
version = "1.62.0rc2"
57+
version = "1.62.0rc3"
5858
description = "Homeserver for the Matrix decentralised comms protocol"
5959
authors = ["Matrix.org Team and Contributors <[email protected]>"]
6060
license = "Apache-2.0"

synapse/storage/databases/main/event_push_actions.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,12 @@ def _rotate_notifs_txn(self, txn: LoggingTransaction) -> bool:
982982
stream_row = txn.fetchone()
983983
if stream_row:
984984
(offset_stream_ordering,) = stream_row
985-
rotate_to_stream_ordering = offset_stream_ordering
985+
986+
# We need to bound by the current token to ensure that we handle
987+
# out-of-order writes correctly.
988+
rotate_to_stream_ordering = min(
989+
offset_stream_ordering, self._stream_id_gen.get_current_token()
990+
)
986991
caught_up = False
987992
else:
988993
rotate_to_stream_ordering = self._stream_id_gen.get_current_token()
@@ -1014,7 +1019,7 @@ def _rotate_notifs_before_txn(
10141019
SELECT user_id, room_id, count(*) as cnt,
10151020
max(stream_ordering) as stream_ordering
10161021
FROM event_push_actions
1017-
WHERE ? <= stream_ordering AND stream_ordering < ?
1022+
WHERE ? < stream_ordering AND stream_ordering <= ?
10181023
AND %s = 1
10191024
GROUP BY user_id, room_id
10201025
) AS upd

tests/storage/test_event_push_actions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ def _mark_read(stream: int, depth: int) -> None:
148148
_assert_counts(0, 0)
149149
_inject_actions(1, PlAIN_NOTIF)
150150
_assert_counts(1, 0)
151-
_rotate(2)
151+
_rotate(1)
152152
_assert_counts(1, 0)
153153

154154
_inject_actions(3, PlAIN_NOTIF)
155155
_assert_counts(2, 0)
156-
_rotate(4)
156+
_rotate(3)
157157
_assert_counts(2, 0)
158158

159159
_inject_actions(5, PlAIN_NOTIF)
@@ -164,7 +164,7 @@ def _mark_read(stream: int, depth: int) -> None:
164164
_assert_counts(0, 0)
165165

166166
_inject_actions(6, PlAIN_NOTIF)
167-
_rotate(7)
167+
_rotate(6)
168168
_assert_counts(1, 0)
169169

170170
self.get_success(
@@ -180,13 +180,13 @@ def _mark_read(stream: int, depth: int) -> None:
180180

181181
_inject_actions(8, HIGHLIGHT)
182182
_assert_counts(1, 1)
183-
_rotate(9)
183+
_rotate(8)
184184
_assert_counts(1, 1)
185185

186186
# Check that adding another notification and rotating after highlight
187187
# works.
188188
_inject_actions(10, PlAIN_NOTIF)
189-
_rotate(11)
189+
_rotate(10)
190190
_assert_counts(2, 1)
191191

192192
# Check that sending read receipts at different points results in the

0 commit comments

Comments
 (0)