element-hq / element-x-android

Android Matrix messenger application using the Matrix Rust Sdk and Jetpack Compose
GNU Affero General Public License v3.0
1.07k stars 152 forks source link

Simplified Sliding Sync should be enabled by default if your homeserver supports it (and doesn't have a SS proxy). #3256

Closed Half-Shot closed 1 month ago

Half-Shot commented 3 months ago

Update

Currently in order to use EX you need to:

So probably this just needs to be a thing where if the simplified feature is enabled and the proxy isn't, we go straight for simplified.

My quite wrong ramblings are preserved below.

Your use case

What would you like to do?

I'd like to run Element X using just Synapse and the Simplified Sliding Sync feature.

Why would you like to do it?

I'd really like to use Element X, and I don't want to run the SS Proxy.

How would you like to achieve it?

Probably we should have a mechanism to detect if the homeserver supports Simplified Sliding Sync and pre-enable the developer flag for the moment. Maybe a /versions check, although the feature doesn't have a corresponding flag. I suppose you could also just POST the endpoint and check to see if it comes back with something other than 404. The possibilities are endless!

Have you considered any alternatives?

The clear alternative is running a proxy, and then turning it off. For obvious reasons, absolutely not :)

Additional context

https://github.com/element-hq/element-x-android/pull/3222 is the PR that added the feature.

Are you willing to provide a PR?

No

Half-Shot commented 3 months ago

The Rust side of this is https://github.com/matrix-org/matrix-rust-sdk/blob/d03d3cff1707743af898c89a2e30b301e79e3845/crates/matrix-sdk/src/client/builder.rs#L475-L493.

Which is triggered by https://github.com/element-hq/element-x-android/blob/b9942ccf6ab3d607b46b466e41dcd280116cd3d3/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClientFactory.kt#L53-L115. Essentially perhaps the Rust SDK needs to say "hey, we couldn't find a proxy but the homeserver claims simplified sync support" which the client might be able to optionally decide to accept (perhaps with a warning to the user that dragons exist).

bmarty commented 2 months ago

which the client might be able to optionally decide to accept

I do not think the client need to validate the usage of SSS. I believe the feature flag has been added to prevent user from being stuck if there is a problem with SSS and using the proxy was OK.

So I think the SDK should use SSS if there is no proxy.

WDYT @Hywan ?

Hywan commented 2 months ago

It's the entire migration from SS proxy to SS native project, https://github.com/element-hq/element-meta/issues/2499. I think it's better to close this issue, as it will create duplicated discussions.

xxfogs commented 1 month ago

But so will we see this anytime soon?

Hywan commented 1 month ago

@bmarty Does Element X Android support detecting and switching from SS proxy to SSS (MSC3575 <> MSC4186)?

Hywan commented 1 month ago

But so will we see this anytime soon?

Element X iOS (nightly) does already support this yes.

xxfogs commented 1 month ago

But so will we see this anytime soon?

Element X iOS (nightly) does already support this yes.

Oh, that's splendid. I hope that soon gets implemented in the android version as well.

athei commented 1 month ago

But so will we see this anytime soon?

Element X iOS (nightly) does already support this yes.

Can you maybe point me to the commit that added this support? I am looking through the changes since the last release and can't find it.

Hywan commented 1 month ago

cc @stefanceriu @jmartinesp :-)

stefanceriu commented 1 month ago

Default to native sliding sync discovery. -> https://github.com/element-hq/element-x-ios/pull/3211/commits/e47e76c3cb5105a2d37dcc3a5441f4bc153a7889

jmartinesp commented 1 month ago

Migration to native SS PR: https://github.com/element-hq/element-x-android/pull/3429

Force logout when SS proxy is no longer available but native SS is (aka forced migration): https://github.com/element-hq/element-x-android/pull/3458

Fix for native sliding sync being incorrectly forced: https://github.com/element-hq/element-x-android/pull/3489

Note that having native sliding sync enabled in the EX app is currently based in a developer setting flag that it's now true by default, but if you changed it in the past, it'll keep that value, whether it was enabled or disabled.

manuroe commented 1 month ago

We have everything in place to have this working. We just forgot to close this issue in favor of the work that happened in https://github.com/element-hq/element-meta/issues/2499. Check it on 0.6.3. If there is an issue, raise a new ticket explaining the problem.