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
2cd29dbd
Commit
2cd29dbd
authored
10 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug where accepting invite over federation didn't work. Add logging.
parent
7d897f5b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/handlers/federation.py
+49
-8
49 additions, 8 deletions
synapse/handlers/federation.py
with
49 additions
and
8 deletions
synapse/handlers/federation.py
+
49
−
8
View file @
2cd29dbd
...
...
@@ -343,6 +343,10 @@ class FederationHandler(BaseHandler):
for
e
in
auth_chain
:
e
.
internal_metadata
.
outlier
=
True
if
e
.
event_id
==
event
.
event_id
:
continue
try
:
auth_ids
=
[
e_id
for
e_id
,
_
in
e
.
auth_events
]
auth
=
{
...
...
@@ -359,7 +363,9 @@ class FederationHandler(BaseHandler):
)
for
e
in
state
:
# FIXME: Auth these.
if
e
.
event_id
==
event
.
event_id
:
continue
e
.
internal_metadata
.
outlier
=
True
try
:
auth_ids
=
[
e_id
for
e_id
,
_
in
e
.
auth_events
]
...
...
@@ -376,11 +382,18 @@ class FederationHandler(BaseHandler):
e
.
event_id
,
)
auth_ids
=
[
e_id
for
e_id
,
_
in
event
.
auth_events
]
auth_events
=
{
(
e
.
type
,
e
.
state_key
):
e
for
e
in
auth_chain
if
e
.
event_id
in
auth_ids
}
yield
self
.
_handle_new_event
(
target_host
,
new_event
,
state
=
state
,
current_state
=
state
,
auth_events
=
auth_events
,
)
yield
self
.
notifier
.
on_new_room_event
(
...
...
@@ -752,7 +765,17 @@ class FederationHandler(BaseHandler):
origin
,
event
.
room_id
,
event
.
event_id
)
seen_remotes
=
yield
self
.
store
.
have_events
(
[
e
.
event_id
for
e
in
remote_auth_chain
]
)
for
e
in
remote_auth_chain
:
if
e
.
event_id
in
seen_remotes
.
keys
():
continue
if
e
.
event_id
==
event
.
event_id
:
continue
try
:
auth_ids
=
[
e_id
for
e_id
,
_
in
e
.
auth_events
]
auth
=
{
...
...
@@ -760,10 +783,17 @@ class FederationHandler(BaseHandler):
if
e
.
event_id
in
auth_ids
}
e
.
internal_metadata
.
outlier
=
True
logger
.
debug
(
"
do_auth %s missing_auth: %s
"
,
event
.
event_id
,
e
.
event_id
)
yield
self
.
_handle_new_event
(
origin
,
e
,
auth_events
=
auth
)
auth_events
[(
e
.
type
,
e
.
state_key
)]
=
e
if
e
.
event_id
in
event_auth_events
:
auth_events
[(
e
.
type
,
e
.
state_key
)]
=
e
except
AuthError
:
pass
...
...
@@ -788,20 +818,31 @@ class FederationHandler(BaseHandler):
local_auth_chain
,
)
seen_remotes
=
yield
self
.
store
.
have_events
(
[
e
.
event_id
for
e
in
result
[
"
auth_chain
"
]]
)
# 3. Process any remote auth chain events we haven't seen.
for
missing_id
in
result
.
get
(
"
missing
"
,
[]):
try
:
for
e
in
result
[
"
auth_chain
"
]:
if
e
.
event_id
==
missing_id
:
ev
=
e
break
for
ev
in
result
[
"
auth_chain
"
]:
if
ev
.
event_id
in
seen_remotes
.
keys
():
continue
if
ev
.
event_id
==
event
.
event_id
:
continue
try
:
auth_ids
=
[
e_id
for
e_id
,
_
in
ev
.
auth_events
]
auth
=
{
(
e
.
type
,
e
.
state_key
):
e
for
e
in
result
[
"
auth_chain
"
]
if
e
.
event_id
in
auth_ids
}
ev
.
internal_metadata
.
outlier
=
True
logger
.
debug
(
"
do_auth %s different_auth: %s
"
,
event
.
event_id
,
e
.
event_id
)
yield
self
.
_handle_new_event
(
origin
,
ev
,
auth_events
=
auth
)
...
...
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