element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.02k stars 1.96k forks source link

Email invites broken - sometimes #15576

Open the-moog opened 3 years ago

the-moog commented 3 years ago

Description

Registration vie email invite feature is broken again, sometimes. I think now I realise that it's just unreliable. I've raised similar bugs before only to close them when I think it's fixed. Now I realise that it's just intermittent.

At first I thought this was due to an upgrade from 1.7.4 to 1.7.10. In investigating this I went through all releases from 1.7.4 to 1.7.11. I also tried multiple browsers. It does not seem to be related to the version.

The new user is sent an invite via an email by entering the users supplied email on a Invite to Room dialog.

When the user clicks the link in the email they should find the email address pre-filled. If this does not happen then the user often enters a different email and the registration fails.

I found that sometimes in Firefox when a user clicks the link in an email invite, the email address they used for the invite is not pre-filled in the registration dialog.

After the downgrade (and server restart) Firefox started working again. Chrome seems to always work. A Firefox private windows seems to always fail.

When it fails I can see that the HTML for the email control in the registration dialog has the value="".

Somehow the rendering of the same form changes depending on the browser session and the server state.

Any suggestions as to what I can do to further debug this issue?

Steps to reproduce

Invite a non-existent user to a room with an email address

They get an email with a link like https://element.server.com/#/register?email=user12345%40gmail.com

Describe how what happens differs from what you expected.

Clicking the link should take them to the registration page where the supplied email (in the link) is prefilled.

Sometimes this field is empty.

Logs being sent: yes/no

Version information

For the web app:

the-moog commented 3 years ago

Update: After restarting both Firefox and Chrome. Chrome now also exhibits the same issue. Perhaps it's some form of race condition?

I also find that in FF, the Register button is broken - I'll raise another bug.

jryans commented 3 years ago

Invite a non-existent user to a room with an email address

They get an email with a link like https://element.server.com/#/register?email=user12345%40gmail.com

Hmm, I am trying to reproduce, but so far I don't see that behaviour. Instead, when inviting a user via email who doesn't have a Matrix account, I get an email with link such as:

https://app.element.io/#/room/<roomId>?email=<email>&signurl=<identityServerUrl>&room_name=<roomName>&room_avatar_url=&inviter_name=<myName>&guest_access_token=&guest_user_id=

In Settings -> General for your inviting account, are you connected or disconnected to an Identity Server?

the-moog commented 3 years ago

The IS (identity server) is MA1SD that is generating the invites. Could it be getting the protocol wrong or be involved in some race condition or timeout creating the hit/miss effect we are seeing?

jryans commented 3 years ago

Hmm, perhaps so. It's a bit hard to investigate without a path to reproducing the issue. Is there a test server that could be used somewhere?