Skip to content

Commit

Permalink
Merge tag 'v1.85.2' into develop
Browse files Browse the repository at this point in the history
Synapse 1.85.2 (2023-06-08)
===========================

Bugfixes
--------

- Fix regression where using TLS for HTTP replication between workers did not work. Introduced in v1.85.0. ([\matrix-org#15746](matrix-org#15746))
  • Loading branch information
yingziwu committed Jun 8, 2023
2 parents 05c8839 + ac3a70a commit 56a3ff3
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 3 deletions.
20 changes: 20 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
Synapse 1.85.2 (2023-06-08)
===========================

Bugfixes
--------

- Fix regression where using TLS for HTTP replication between workers did not work. Introduced in v1.85.0. ([\#15746](https://github.com/matrix-org/synapse/issues/15746))


Synapse 1.85.1 (2023-06-07)
===========================

Note: this release only fixes a bug that stopped some deployments from upgrading to v1.85.0. There is no need to upgrade to v1.85.1 if successfully running v1.85.0.

Bugfixes
--------

- Fix bug in schema delta that broke upgrades for some deployments. Introduced in v1.85.0. ([\#15738](https://github.com/matrix-org/synapse/issues/15738), [\#15739](https://github.com/matrix-org/synapse/issues/15739))


Synapse 1.85.0 (2023-06-06)
===========================

Expand Down
12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
matrix-synapse-py3 (1.85.2) stable; urgency=medium

* New Synapse release 1.85.2.

-- Synapse Packaging team <[email protected]> Thu, 08 Jun 2023 13:04:18 +0100

matrix-synapse-py3 (1.85.1) stable; urgency=medium

* New Synapse release 1.85.1.

-- Synapse Packaging team <[email protected]> Wed, 07 Jun 2023 10:51:12 +0100

matrix-synapse-py3 (1.85.0) stable; urgency=medium

* New Synapse release 1.85.0.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ manifest-path = "rust/Cargo.toml"

[tool.poetry]
name = "matrix-synapse"
version = "1.85.0"
version = "1.85.2"
description = "Homeserver for the Matrix decentralised comms protocol"
authors = ["Matrix.org Team and Contributors <[email protected]>"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion synapse/http/replicationagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def endpointForURI(self, uri: URI) -> IStreamClientEndpoint:
endpoint = wrapClientTLS(
# The 'port' argument below isn't actually used by the function
self.context_factory.creatorForNetloc(
self.instance_map[worker_name].host,
self.instance_map[worker_name].host.encode("utf-8"),
self.instance_map[worker_name].port,
),
endpoint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,27 @@ DELETE FROM background_updates WHERE update_name = 'event_push_backfill_thread_i
-- Overwrite any null thread_id values.
UPDATE event_push_actions_staging SET thread_id = 'main' WHERE thread_id IS NULL;
UPDATE event_push_actions SET thread_id = 'main' WHERE thread_id IS NULL;
UPDATE event_push_summary SET thread_id = 'main' WHERE thread_id IS NULL;

-- Empirically we can end up with entries in the push summary table with both a
-- `NULL` and `main` thread ID, which causes the insert below to fail. We fudge
-- this by deleting any `NULL` rows that have a corresponding `main`.
DELETE FROM event_push_summary AS a WHERE thread_id IS NULL AND EXISTS (
SELECT 1 FROM event_push_summary AS b
WHERE b.thread_id = 'main' AND a.user_id = b.user_id AND a.room_id = b.room_id
);
-- Copy the NULL threads to have a 'main' thread ID.
--
-- Note: Some people seem to have duplicate rows with a `NULL` thread ID, in
-- which case we just fudge it with using MAX of the values. The counts *may* be
-- wrong for such rooms, but a) its an edge case, and b) they'll be fixed when
-- the user reads the room.
INSERT INTO event_push_summary (user_id, room_id, notif_count, stream_ordering, unread_count, last_receipt_stream_ordering, thread_id)
SELECT user_id, room_id, MAX(notif_count), MAX(stream_ordering), MAX(unread_count), MAX(last_receipt_stream_ordering), 'main'
FROM event_push_summary
WHERE thread_id IS NULL
GROUP BY user_id, room_id, thread_id;

DELETE FROM event_push_summary AS a WHERE thread_id IS NULL;

-- Drop the background updates to calculate the indexes used to find null thread_ids.
DELETE FROM background_updates WHERE update_name = 'event_push_actions_thread_id_null';
Expand Down

0 comments on commit 56a3ff3

Please sign in to comment.