Inviting a user from a server with allow_profile_lookup_over_federation false gives a confusing error message
See original GitHub issueWe tried inviting a user from a server with allow_profile_lookup_over_federation: false and include_profile_data_on_invite: false (not sure which of those settings is actually relevant here) to an invite-only room. This causes Element to say (I can’t remember the exact error message, sorry) that the profile might be invalid and won’t let us inviting that user. The error on the inviting user’s home server is:
May 11 22:00:12 matrix matrix-synapse-synchrotron9100[3783]: synapse.http.matrixfederationclient - 612 - WARNING - GET-67720 - {GET-O-51} [other.home.server] Request failed: GET matrix://other.home.server/_matrix/federation/v1/query/profile?user_id=%40some.user%3Aother.home.server&field=displayname: HttpResponseException('403: Forbidden‘)
Disabling the “warn before sending invites to invalid Matrix IDs” setting in the Element settings allows inviting the user and the invited user can join the room.
This is a least somewhat inconsistent in the wording as the Matrix ID is not invalid and it is not clear that it is possible to switch off that setting.
It also seems prior Element versions did not hinder inviting users from home servers with the above settings, some other user tried to reproduce this issue on Element 1.7.24 and did not see the above error message.
Element version of the inviting user: 1.7.27 macOS Desktop client Synapse version of the inviting user: 1.33.2 Synapse version of the invited user: 1.31.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:13
- Comments:7 (2 by maintainers)

Top Related StackOverflow Question
The message displayed by element-web when inviting over the GUI seems to have changed, but the result is still the same.
In the Preferences there is the option
Prompt before sending invites to potentially invalid matrix IDs. Disabling this option only changes the behavior of\invite, but not when inviting through the GUI. This option also does not really solve the problem, since I can not control this option for the element-web of the user who wants to invite me over federation.Inviting someone using the “Invite to this room” button yields:
I only have the option to press OK.
My client made a request to
https://matrix-client.matrix.org/_matrix/client/r0/profile/<MXID>which returned 403. I’m guessing that Element Web doesn’t have logic to handle a 403 or otherwise doesn’t expect it? The surprising thing is that we don’t seem to have tried to make an/invite/request at all.In fairness to Element-Web, the spec says the only response codes are 200 and 404. Spec deficiency? https://spec.matrix.org/v1.1/client-server-api/#get_matrixclientv3profileuserid