Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tests/federation_room_join_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,3 +522,28 @@ func TestSendJoinPartialStateResponse(t *testing.T) {
func typeAndStateKeyForEvent(result gjson.Result) string {
return strings.Join([]string{result.Map()["type"].Str, result.Map()["state_key"].Str}, "|")
}

func TestJoinFederatedRoomFromApplicationServiceBridgeUser(t *testing.T) {
deployment := Deploy(t, b.BlueprintHSWithApplicationService)
defer deployment.Destroy(t)

// Create the application service bridge user to try to join the room from
asUserID := "@the-bridge-user:hs1"
as := deployment.Client(t, "hs1", asUserID)

// Create the federated remote user which will create the room
remoteUserID := "@charlie:hs2"
remoteCharlie := deployment.Client(t, "hs2", remoteUserID)

t.Run("join remote federated room as application service user", func(t *testing.T) {
//t.Parallel()
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that we have t.Parallel() commented out elsewhere in this file. Do we care about it also being here?

// Create the room from a remote homeserver
roomID := remoteCharlie.CreateRoom(t, map[string]interface{}{
"preset": "public_chat",
"name": "hs2 room",
})

// Join the AS bridge user to the remote federated room (without a profile set)
as.JoinRoom(t, roomID, []string{"hs2"})
Copy link
Copy Markdown
Collaborator Author

@MadLittleMods MadLittleMods Jun 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test failing in Dendrite. I'm guessing we don't configure application service registrations in it like we do for Synapse.

https://github.com/matrix-org/complement/runs/7116659758?check_suite_focus=true#step:8:415

❌ TestJoinFederatedRoomFromApplicationServiceUser/join_remote_federated_room_as_application_service_user (180ms)
      federation_room_join_test.go:547: CSAPI.MustDoFunc response return non-2xx code: 401 Unauthorized - body: {"errcode":"M_UNKNOWN_TOKEN","error":"Unknown token"}
  2022/06/29 16:59:07 ============================================

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @kegsay

Copy link
Copy Markdown
Collaborator Author

@MadLittleMods MadLittleMods Jul 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought AS support wasn't fully implemented yet in Complement?

Complement does support configuring application services. For Synapse, that means setting up the registration. But the application service server doesn't work yet. In the tests so far, I've only needed the as_token to do certain actions.

Application service servers not needed/supported until #221 (review)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, okay. Then yeah the Dendrite image won't read the registration files yet. Skip them on Dendrite please.

})
}