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

Commit

Permalink
Merge tag 'v1.44.0rc3' into develop
Browse files Browse the repository at this point in the history
Synapse 1.44.0rc3 (2021-10-04)
==============================

Bugfixes
--------

- Fix a bug introduced in Synapse v1.40.0 where changing a user's display name or avatar in a restricted room would cause an authentication error. ([\#10933](#10933))
- Fix `/admin/whois/{user_id}` endpoint, which was broken in v1.44.0rc1. ([\#10968](#10968))
  • Loading branch information
babolivier committed Oct 4, 2021
2 parents f7b034a + 2d2c6a4 commit 730b40d
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 4 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.44.0rc3 (2021-10-04)
==============================

Bugfixes
--------

- Fix a bug introduced in Synapse v1.40.0 where changing a user's display name or avatar in a restricted room would cause an authentication error. ([\#10933](https://github.com/matrix-org/synapse/issues/10933))
- Fix `/admin/whois/{user_id}` endpoint, which was broken in v1.44.0rc1. ([\#10968](https://github.com/matrix-org/synapse/issues/10968))


Synapse 1.44.0rc2 (2021-09-30)
==============================

Expand Down
1 change: 0 additions & 1 deletion changelog.d/10933.bugfix

This file was deleted.

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.44.0~rc3) stable; urgency=medium

* New synapse release 1.44.0~rc3.

-- Synapse Packaging team <[email protected]> Mon, 04 Oct 2021 14:57:22 +0100

matrix-synapse-py3 (1.44.0~rc2) stable; urgency=medium

* New synapse release 1.44.0~rc2.
Expand Down
2 changes: 1 addition & 1 deletion synapse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
except ImportError:
pass

__version__ = "1.44.0rc2"
__version__ = "1.44.0rc3"

if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)):
# We import here so that we don't have to install a bunch of deps when
Expand Down
4 changes: 2 additions & 2 deletions synapse/storage/databases/main/client_ips.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,8 @@ def get_recent(txn):
)

results.update(
((row["access_token"], row["ip"]), (row["user_agent"], row["last_seen"]))
for row in rows
((access_token, ip), (user_agent, last_seen))
for access_token, ip, user_agent, last_seen in rows
)
return [
{
Expand Down
34 changes: 34 additions & 0 deletions tests/storage/test_client_ips.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@

from unittest.mock import Mock

from parameterized import parameterized

import synapse.rest.admin
from synapse.http.site import XForwardedForRequest
from synapse.rest.client import login
from synapse.types import UserID

from tests import unittest
from tests.server import make_request
Expand Down Expand Up @@ -143,6 +146,37 @@ def test_insert_new_client_ip_none_device_id(self):
],
)

@parameterized.expand([(False,), (True,)])
def test_get_user_ip_and_agents(self, after_persisting: bool):
"""Test `get_user_ip_and_agents` for persisted and unpersisted data"""
self.reactor.advance(12345678)

user_id = "@user:id"
user = UserID.from_string(user_id)

# Insert a user IP
self.get_success(
self.store.insert_client_ip(
user_id, "access_token", "ip", "user_agent", "MY_DEVICE"
)
)

if after_persisting:
# Trigger the storage loop
self.reactor.advance(10)

self.assertEqual(
self.get_success(self.store.get_user_ip_and_agents(user)),
[
{
"access_token": "access_token",
"ip": "ip",
"user_agent": "user_agent",
"last_seen": 12345678000,
},
],
)

@override_config({"limit_usage_by_mau": False, "max_mau_value": 50})
def test_disabled_monthly_active_user(self):
user_id = "@user:server"
Expand Down

0 comments on commit 730b40d

Please sign in to comment.