Skip to content

Commit

Permalink
Merge branch 'release-v1.109' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhose committed Jun 11, 2024
2 parents 863578b + e6816ba commit 0248ed7
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 10 deletions.
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Synapse 1.109.0rc2 (2024-06-11)

### Bugfixes

- Fix bug where one-time-keys were not always included in `/sync` response when using workers. Introduced in v1.109.0rc1. ([\#17275](https://github.com/element-hq/synapse/issues/17275))
- Fix bug where `/sync` could get stuck due to edge case in device lists handling. Introduced in v1.109.0rc1. ([\#17292](https://github.com/element-hq/synapse/issues/17292))




# Synapse 1.109.0rc1 (2024-06-04)

### Features
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
matrix-synapse-py3 (1.109.0~rc2) stable; urgency=medium

* New synapse release 1.109.0rc2.

-- Synapse Packaging team <packages@matrix.org> Tue, 11 Jun 2024 13:20:17 +0000

matrix-synapse-py3 (1.109.0~rc1) stable; urgency=medium

* New Synapse release 1.109.0rc1.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ module-name = "synapse.synapse_rust"

[tool.poetry]
name = "matrix-synapse"
version = "1.109.0rc1"
version = "1.109.0rc2"
description = "Homeserver for the Matrix decentralised comms protocol"
authors = ["Matrix.org Team and Contributors <packages@matrix.org>"]
license = "AGPL-3.0-or-later"
Expand Down
28 changes: 19 additions & 9 deletions synapse/storage/databases/main/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ def __init__(
("device_lists_outbound_pokes", "instance_name", "stream_id"),
("device_lists_changes_in_room", "instance_name", "stream_id"),
("device_lists_remote_pending", "instance_name", "stream_id"),
(
"device_lists_changes_converted_stream_position",
"instance_name",
"stream_id",
),
],
sequence_name="device_lists_sequence",
writers=["master"],
Expand Down Expand Up @@ -2394,15 +2399,16 @@ async def get_device_change_last_converted_pos(self) -> Tuple[int, str]:
`FALSE` have not been converted.
"""

return cast(
Tuple[int, str],
await self.db_pool.simple_select_one(
table="device_lists_changes_converted_stream_position",
keyvalues={},
retcols=["stream_id", "room_id"],
desc="get_device_change_last_converted_pos",
),
# There should be only one row in this table, though we want to
# future-proof ourselves for when we have multiple rows (one for each
# instance). So to handle that case we take the minimum of all rows.
rows = await self.db_pool.simple_select_list(
table="device_lists_changes_converted_stream_position",
keyvalues={},
retcols=["stream_id", "room_id"],
desc="get_device_change_last_converted_pos",
)
return cast(Tuple[int, str], min(rows))

async def set_device_change_last_converted_pos(
self,
Expand All @@ -2417,6 +2423,10 @@ async def set_device_change_last_converted_pos(
await self.db_pool.simple_update_one(
table="device_lists_changes_converted_stream_position",
keyvalues={},
updatevalues={"stream_id": stream_id, "room_id": room_id},
updatevalues={
"stream_id": stream_id,
"instance_name": self._instance_name,
"room_id": room_id,
},
desc="set_device_change_last_converted_pos",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--
-- This file is licensed under the Affero General Public License (AGPL) version 3.
--
-- Copyright (C) 2024 New Vector, Ltd
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as
-- published by the Free Software Foundation, either version 3 of the
-- License, or (at your option) any later version.
--
-- See the GNU Affero General Public License for more details:
-- <https://www.gnu.org/licenses/agpl-3.0.html>.

-- Add `instance_name` columns to stream tables to allow them to be used with
-- `MultiWriterIdGenerator`
ALTER TABLE device_lists_changes_converted_stream_position ADD COLUMN instance_name TEXT;

0 comments on commit 0248ed7

Please sign in to comment.