Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
01a5a8b9
Commit
01a5a8b9
authored
6 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Fix checking if service notice room is already tagged
This manifested in synapse repeatedly setting the tag for the room
parent
897d976c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/server_notices/resource_limits_server_notices.py
+3
-4
3 additions, 4 deletions
synapse/server_notices/resource_limits_server_notices.py
tests/server_notices/test_resource_limits_server_notices.py
+1
-0
1 addition, 0 deletions
tests/server_notices/test_resource_limits_server_notices.py
with
4 additions
and
4 deletions
synapse/server_notices/resource_limits_server_notices.py
+
3
−
4
View file @
01a5a8b9
...
...
@@ -146,11 +146,10 @@ class ResourceLimitsServerNotices(object):
user_id(str): the user in question
room_id(str): the server notices room for that user
"""
tags
=
yield
self
.
_store
.
get_tags_for_user
(
user_id
)
server_notices_tags
=
tags
.
get
(
room_id
)
tags
=
yield
self
.
_store
.
get_tags_for_room
(
user_id
,
room_id
)
need_to_set_tag
=
True
if
server_notices_
tags
:
if
server_notices_tags
.
get
(
SERVER_NOTICE_ROOM_TAG
)
:
if
tags
:
if
SERVER_NOTICE_ROOM_TAG
in
tags
:
# tag already present, nothing to do here
need_to_set_tag
=
False
if
need_to_set_tag
:
...
...
This diff is collapsed.
Click to expand it.
tests/server_notices/test_resource_limits_server_notices.py
+
1
−
0
View file @
01a5a8b9
...
...
@@ -55,6 +55,7 @@ class TestResourceLimitsServerNotices(unittest.TestCase):
returnValue
=
""
)
self
.
_rlsn
.
_store
.
add_tag_to_room
=
Mock
()
self
.
_rlsn
.
_store
.
get_tags_for_room
=
Mock
(
return_value
=
{})
self
.
hs
.
config
.
admin_uri
=
"
mailto:user@test.com
"
@defer.inlineCallbacks
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment