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
Container registry
Model registry
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
Maunium
synapse
Commits
70e18cee
Commit
70e18cee
authored
5 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Plain Diff
Merge branch 'rav/redactions/cross_room_id' into release-v1.2.1
parents
c0a1301c
b1605cdd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/5767.bugfix
+1
-0
1 addition, 0 deletions
changelog.d/5767.bugfix
synapse/storage/events_worker.py
+27
-0
27 additions, 0 deletions
synapse/storage/events_worker.py
with
28 additions
and
0 deletions
changelog.d/5767.bugfix
0 → 100644
+
1
−
0
View file @
70e18cee
Log when a redaction attempts to redact an event in a different room.
This diff is collapsed.
Click to expand it.
synapse/storage/events_worker.py
+
27
−
0
View file @
70e18cee
...
@@ -268,6 +268,14 @@ class EventsWorkerStore(SQLBaseStore):
...
@@ -268,6 +268,14 @@ class EventsWorkerStore(SQLBaseStore):
)
)
continue
continue
if
original_event
.
room_id
!=
entry
.
event
.
room_id
:
logger
.
info
(
"
Withholding redaction %s of event %s from a different room
"
,
event_id
,
redacted_event_id
,
)
continue
if
entry
.
event
.
internal_metadata
.
need_to_check_redaction
():
if
entry
.
event
.
internal_metadata
.
need_to_check_redaction
():
original_domain
=
get_domain_from_id
(
original_event
.
sender
)
original_domain
=
get_domain_from_id
(
original_event
.
sender
)
redaction_domain
=
get_domain_from_id
(
entry
.
event
.
sender
)
redaction_domain
=
get_domain_from_id
(
entry
.
event
.
sender
)
...
@@ -636,9 +644,21 @@ class EventsWorkerStore(SQLBaseStore):
...
@@ -636,9 +644,21 @@ class EventsWorkerStore(SQLBaseStore):
if
not
redaction_entry
:
if
not
redaction_entry
:
# we don't have the redaction event, or the redaction event was not
# we don't have the redaction event, or the redaction event was not
# authorized.
# authorized.
logger
.
debug
(
"
%s was redacted by %s but redaction not found/authed
"
,
original_ev
.
event_id
,
redaction_id
,
)
continue
continue
redaction_event
=
redaction_entry
.
event
redaction_event
=
redaction_entry
.
event
if
redaction_event
.
room_id
!=
original_ev
.
room_id
:
logger
.
debug
(
"
%s was redacted by %s but redaction was in a different room!
"
,
original_ev
.
event_id
,
redaction_id
,
)
continue
# Starting in room version v3, some redactions need to be
# Starting in room version v3, some redactions need to be
# rechecked if we didn't have the redacted event at the
# rechecked if we didn't have the redacted event at the
...
@@ -650,8 +670,15 @@ class EventsWorkerStore(SQLBaseStore):
...
@@ -650,8 +670,15 @@ class EventsWorkerStore(SQLBaseStore):
redaction_event
.
internal_metadata
.
recheck_redaction
=
False
redaction_event
.
internal_metadata
.
recheck_redaction
=
False
else
:
else
:
# Senders don't match, so the event isn't actually redacted
# Senders don't match, so the event isn't actually redacted
logger
.
debug
(
"
%s was redacted by %s but the senders don
'
t match
"
,
original_ev
.
event_id
,
redaction_id
,
)
continue
continue
logger
.
debug
(
"
Redacting %s due to %s
"
,
original_ev
.
event_id
,
redaction_id
)
# we found a good redaction event. Redact!
# we found a good redaction event. Redact!
redacted_event
=
prune_event
(
original_ev
)
redacted_event
=
prune_event
(
original_ev
)
redacted_event
.
unsigned
[
"
redacted_by
"
]
=
redaction_id
redacted_event
.
unsigned
[
"
redacted_by
"
]
=
redaction_id
...
...
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