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
05632745
Unverified
Commit
05632745
authored
4 years ago
by
Erik Johnston
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix chain cover update to handle events with duplicate auth events (#9210)
parent
28f255d5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog.d/9210.bugfix
+1
-0
1 addition, 0 deletions
changelog.d/9210.bugfix
synapse/util/iterutils.py
+1
-1
1 addition, 1 deletion
synapse/util/iterutils.py
tests/util/test_itertools.py
+12
-0
12 additions, 0 deletions
tests/util/test_itertools.py
with
14 additions
and
1 deletion
changelog.d/9210.bugfix
0 → 100644
+
1
−
0
View file @
05632745
Fix chain cover update to handle events with duplicate auth events. Introduced in v1.26.0rc1.
This diff is collapsed.
Click to expand it.
synapse/util/iterutils.py
+
1
−
1
View file @
05632745
...
...
@@ -78,7 +78,7 @@ def sorted_topologically(
if
node
not
in
degree_map
:
continue
for
edge
in
edges
:
for
edge
in
set
(
edges
)
:
if
edge
in
degree_map
:
degree_map
[
node
]
+=
1
...
...
This diff is collapsed.
Click to expand it.
tests/util/test_itertools.py
+
12
−
0
View file @
05632745
...
...
@@ -92,3 +92,15 @@ class SortTopologically(TestCase):
# Valid orderings are `[1, 3, 2, 4]` or `[1, 2, 3, 4]`, but we should
# always get the same one.
self
.
assertEqual
(
list
(
sorted_topologically
([
4
,
3
,
2
,
1
],
graph
)),
[
1
,
2
,
3
,
4
])
def
test_duplicates
(
self
):
"
Test that a graph with duplicate edges work
"
graph
=
{
1
:
[],
2
:
[
1
,
1
],
3
:
[
2
,
2
],
4
:
[
3
]}
# type: Dict[int, List[int]]
self
.
assertEqual
(
list
(
sorted_topologically
([
4
,
3
,
2
,
1
],
graph
)),
[
1
,
2
,
3
,
4
])
def
test_multiple_paths
(
self
):
"
Test that a graph with multiple paths between two nodes work
"
graph
=
{
1
:
[],
2
:
[
1
],
3
:
[
2
],
4
:
[
3
,
2
,
1
]}
# type: Dict[int, List[int]]
self
.
assertEqual
(
list
(
sorted_topologically
([
4
,
3
,
2
,
1
],
graph
)),
[
1
,
2
,
3
,
4
])
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