-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSC2716 federation changes #175
MSC2716 federation changes #175
Conversation
Conflicts: tests/msc2716_test.go
@@ -337,7 +337,6 @@ func TestBackfillingHistory(t *testing.T) { | |||
}) | |||
|
|||
t.Run("Historical messages are visible when joining on federated server - auto-generated base insertion event", func(t *testing.T) { | |||
t.Skip("Skipping until federation is implemented") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing as matrix-org/synapse#10245 is now merged
Synapse support was added in matrix-org/synapse#10498
@@ -569,10 +599,9 @@ func TestBackfillingHistory(t *testing.T) { | |||
}) | |||
|
|||
t.Run("When messages have already been scrolled back through, new historical messages are visible in next scroll back on federated server", func(t *testing.T) { | |||
t.Skip("Skipping until federation is implemented") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing as matrix-org/synapse#10498 is now merged
Synapse change added in matrix-org/synapse#10552
@@ -284,20 +290,53 @@ func TestBackfillingHistory(t *testing.T) { | |||
}) | |||
}) | |||
|
|||
t.Run("Batch send endpoint only returns state events that we passed in via state_events_at_start", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test added to verify matrix-org/synapse#10552
tests/msc2716_test.go
Outdated
// We only expect 1 state event to be returned because we only passed in 1 | ||
// event into `?state_events_at_start` | ||
if len(stateEventIDs) != 1 { | ||
t.Fatalf("Expected only 1 state event to be returned but received %d: %s", len(stateEventIDs), stateEventIDs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t.Fatalf("Expected only 1 state event to be returned but received %d: %s", len(stateEventIDs), stateEventIDs) | |
t.Fatalf("Expected only 1 state event to be returned but received %d: %v", len(stateEventIDs), stateEventIDs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own reference, what's the benefit of using %v
vs %s
here?
They both appear like:
Expected only 1 state event to be returned but received 1: [$EVEa7PzafkdmDIu4kEYwlqJFSSKV_pj5h5xYfRspFs4]
}, | ||
} | ||
// We can't use as.SendEventSynced(...) because application services can't use the /sync API | ||
markerSendRes := as.MustDoFunc(t, "PUT", []string{"_matrix", "client", "r0", "rooms", roomID, "send", markerEvent.Type, "txn-m123"}, client.WithJSONBody(t, markerEvent.Content)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a problem that the txn id never changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the homeserver is new every run, I think it's fine. I did notice that txn-m123
was re-used once, so I updated to something different.
Might be nice to add a helper function to client
to get a random unique one easily (using txnId
in there). I added an internal one in #192
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
Thanks for the review @kegsay and catching the Python patterns that slipped in 🐆 |
MSC2716 federation changes
batchSendHistoricalMessages
to be able to compose state and message eventsstate_events
that we passed in via?state_events_at_start
, Only return state events that the AS passed in viastate_events_at_start
(MSC2716) synapse#10552Dev notes
Todo
state_events_before
includes invitations and join eventsRedacting an insertion, chunk, marker so remove it from our new tracking tablesnext_chunk_id
will reject. ((room_id, next_chunk_id)
should be unique))