Skip to content
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

Cannot invite appservice users which do not (yet) exist #7922

Closed
turt2live opened this issue Dec 20, 2018 · 8 comments
Closed

Cannot invite appservice users which do not (yet) exist #7922

turt2live opened this issue Dec 20, 2018 · 8 comments
Assignees
Labels
P2 S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect

Comments

@turt2live
Copy link
Member

Appservices typically follow this sort of flow:

  1. User invites @_example_user:localhost to a room.
  2. Homeserver finds out that @_example_user:localhost doesn't exist, but is in the namespace for an appservice.
  3. Homeserver queries the appservice so it can create the user
  4. Appservice creates the user
  5. Homeserver finishes processing the invite, sending it to the appservice

Recently we added a proof of life check to see if a user exists before proceeding with the invite though (matrix-org/matrix-react-sdk#2317). This fails on Synapse because the user query isn't done, so the request for a profile fails, which means Riot won't try and invite the user, which means the steps above mean nothing because they aren't executed.

TLDR: Synapse needs to hit the appservice's /users endpoint for profile lookups too.

@turt2live
Copy link
Member Author

(reported as the user-facing bug - will open a synapse issue to track the backend issue)

@lampholder lampholder added T-Defect P2 S-Major Severely degrades major functionality or product features, with no satisfactory workaround labels Dec 20, 2018
@valentinab25
Copy link

We also have this problem. We are using mxisd as our identity server ( as a synapse password provider integrated with our LDAP ). Since 0.17.8 no new users can be invited in any rooms. We can find the user, but on the SEND INVITES button we receive the error:

Failed to invite the following users to the TEST room:
@LDAPUID:OUR_HOMESERVER: User @LDAPUID:OUR_HOMESERVER does not exist

@maxidorius
Copy link

maxidorius commented Jan 4, 2019

This issue is not limited to appservices but to at least the following set of existing tools:

  • Password providers
  • mxisd
  • Profile enhancers or Gateways which may return 404 at their own discretion as allowed by the profile endpoint spec even if a profile exists

A more detailed explanation of why this needs to be rolled back is available on the PR.

@lampholder
Copy link
Member

A spec change is being discussed as to the merits of checking /profile and how we might enhance this API (or add a new one) to handle checking whether a user exists. However, we've decided that for now we can power through client side if we:

  • expose a warning when you try and invite a mxid we can't confirm exists (but let you continue with the invite if you wish)
  • make this warning optional, to be configured on either a per user or per riot deploy basis

@turt2live turt2live self-assigned this Jan 11, 2019
turt2live added a commit to matrix-org/matrix-react-sdk that referenced this issue Jan 11, 2019
Fixes element-hq/element-web#7922

This supports the current style of errors (M_NOT_FOUND) as well as the errors presented by MSC1797: matrix-org/matrix-spec-proposals#1797
@turt2live
Copy link
Member Author

turt2live commented Jan 11, 2019

matrix-org/matrix-react-sdk#2434 implements the behaviour @lampholder describes. For those looking to have it always work regardless of account setting, add this to your config.json:

"settingDefaults": {
    "alwaysInviteUnknownUsers": true
}

@turt2live
Copy link
Member Author

Fixed by matrix-org/matrix-react-sdk#2434

@lampholder
Copy link
Member

This still seems to be broken for me on develop.

If I:

  • on lant.uk
  • invite @sdjafldfskla234892374or:matrix.org to a room
    I get an internal server error

Also I don't see the option 'Always invite users who may not exist'.

Also I'd like the option to be called 'Prompt before sending invites to potentially invalid matrix IDs' (defaulting to true). If defaulting to true is difficult, then let's go with 'Skip prompt before sending invites to potentially invalid matrix IDs', which is stretching the definition of an affirmative phrased setting.

If default to true is hard, this is something we need to fix :)

@githuberyt
Copy link

can't invite users from spaces from another server

if spaces on server A and user joined from server B and tried to invite users to spaces this error pop up " Failed to invite users to the room: "

@element-hq element-hq locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P2 S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect
Projects
None yet
Development

No branches or pull requests

6 participants