element-hq / element-x-ios

Next generation Matrix client for iOS built with SwiftUI on top of matrix-rust-sdk.
https://element.io/labs/element-x
GNU Affero General Public License v3.0
433 stars 106 forks source link

Bad internet connection triggers spurious "Your homeserver no longer supports the old protocol" warnings and forces logout. #3382

Open ara4n opened 1 month ago

ara4n commented 1 month ago

Steps to reproduce

  1. Use EX on bad internet (on the tube)

  2. See this: Screenshot 2024-10-08 at 21 34 17

  3. Have no options other than hit 'logout'

  4. Then discover that you don't know your recovery key, and get prompted to reset, and then freak out because you think you're going to lose your message history. (luckily in this instance there was another device logged in).

Outcome

What did you expect?

Never spontaneously log the user out (or force them to logout) due to bad internet connectivity.

Your phone model

No response

Operating system version

No response

Application version

1.8.4 (127)

Homeserver

matrix.org

Will you send logs?

Yes

ara4n commented 1 month ago

And even if the server had been upgraded, it would be rather nice to let the user export their keys or set up backup rather than nuking their history.

pixlwave commented 1 month ago

@Hywan It looks like the API was intentionally designed to not report an error? Should we be doing an extra check here before forcing the logout?

pixlwave commented 1 month ago

And even if the server had been upgraded

The banner shouldn't be shown if it hadn't been upgraded, we specifically check for native support before showing it. So the bug should be limited to the case where the well-known request fails but the /versions request succeeds.

it would be rather nice to let the user export their keys or set up backup rather than nuking their history.

Unless the homeserver admin removed the proxy from the well-known at the point the user had bad connectivity, they will have already seen the banner that says if they don't do it now a force-logout will occur at some point:

Your server now supports a new, faster protocol. Log out and log back in to upgrade now. Doing this now will help you avoid a forced logout when the old protocol is removed later.

Hywan commented 1 month ago

@pixlwave Can you open an issue on matrix-org/matrix-rust-sdk please, so that we can track this properly?

pixlwave commented 1 month ago

I've opened https://github.com/matrix-org/matrix-rust-sdk/issues/4101 👍