Sliding sync not working with Element Web #400

Open
opened 2023-11-05 18:18:15 +00:00 by lnicola · 10 comments
lnicola commented 2023-11-05 18:18:15 +00:00 (Migrated from gitlab.com)

Description

Try to enable sliding sync in Element Web (X works fine). I think I ran into two issues:

System Configuration

Element version: 1.11.47

Olm version: 3.2.14

Conduit Version: 0.7.0-alpha

Database backend: RocksDB

### Description Try to enable sliding sync in Element Web (X works fine). I think I ran into two issues: - https://gitlab.com/famedly/conduit/-/blob/next/src/api/client_server/sync.rs#L1679 waits for 30 seconds, but Element times out after 5 seconds thinking the server doesn't have sliding sync support - ~~if it didn't time out in the previous step, Element still seems to try to validate the proxy address by requesting `/client/server.json`, which Conduit doesn't know about~~ ### System Configuration Element version: 1.11.47 Olm version: 3.2.14 Conduit Version: 0.7.0-alpha Database backend: RocksDB
lnicola commented 2023-11-05 18:20:38 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
lnicola commented 2023-11-05 18:20:48 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
lnicola commented 2023-11-05 18:20:52 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
Thatoo commented 2023-11-15 11:02:17 +00:00 (Migrated from gitlab.com)

I understood that only Element X are sliding sync compatible for now. Element Web don't have this ability yet. So it's not a conduit issue.
If I'm right, this issue can be closed.

I understood that only Element X are sliding sync compatible for now. Element Web don't have this ability yet. So it's not a conduit issue. If I'm right, this issue can be closed.
lnicola commented 2023-11-15 11:07:30 +00:00 (Migrated from gitlab.com)

I couldn't say. Fixing these two issues might make it work without too much of an effort. It's worth trying.

I'll look into it when I have a bit of time.

I couldn't say. Fixing these two issues might make it work without too much of an effort. It's worth trying. I'll look into it when I have a bit of time.
lnicola commented 2023-11-21 13:49:30 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
lnicola commented 2023-11-21 13:51:03 +00:00 (Migrated from gitlab.com)

Update: there's no need to respond to /client/server.json. That request actually goes to the Element Web root, so it's enough to drop a file in there (not sure about desktop).

So after patching the wait, I was able to enable sliding sync in Element Web. I'm not sure yet whether it works.

UPDATE: I don't think it works.

Update: there's no need to respond to `/client/server.json`. That request actually goes to the Element Web root, so it's enough to drop a file in there (not sure about desktop). So after patching the wait, I was able to enable sliding sync in Element Web. I'm not sure yet whether it works. UPDATE: I don't think it works.
solarkraft commented 2023-11-23 21:13:22 +00:00 (Migrated from gitlab.com)

mentioned in issue #403

mentioned in issue #403
girlbossceo commented 2023-11-26 07:19:57 +00:00 (Migrated from gitlab.com)

I think a workaround for the missing file is to just send a response on the reverse proxy side with the necessary JSON. As mentioned here https://github.com/vector-im/element-web/issues/26504#issuecomment-1820931405 it is supposed to be sent by the proxy so it definitely would not be looking at Element Web's location, but it's just a JSON file with the URL of the sliding sync proxy (in this case, your Conduit homeserver URL) and an arbitrary version of the proxy (can just put Conduit 0.7.0-alpha). Similar to what you would do for the client well-known /.well-known/matrix/client

Conduit could probably serve this but it would need to figure out its own homeserver URL, not the server name.

In this case my example for Caddy would be:

        header /client/server.json Content-Type application/json
        respond /client/server.json `{"server":"https://matrix.puppygock.gay","version":"cowonduit 4.2.0-6.9"}`

https://matrix.puppygock.gay/client/server.json

The version should be arbitrary, I can't think of any valid reason why it wouldn't be. If it isn't just take matrix.org's version

Conduit still needs to resolve https://gitlab.com/famedly/conduit/-/issues/404 in addition to the other issue you mentioned for Element Web syncv3 to hopefully work properly.

I think a workaround for the missing file is to just send a response on the reverse proxy side with the necessary JSON. As mentioned here https://github.com/vector-im/element-web/issues/26504#issuecomment-1820931405 it is supposed to be sent by the proxy so it definitely would not be looking at Element Web's location, but it's just a JSON file with the URL of the sliding sync proxy (in this case, your Conduit homeserver URL) and an arbitrary version of the proxy (can just put `Conduit 0.7.0-alpha`). Similar to what you would do for the client well-known `/.well-known/matrix/client` Conduit could _probably_ serve this but it would need to figure out its own homeserver URL, not the server name. In this case my example for Caddy would be: ``` header /client/server.json Content-Type application/json respond /client/server.json `{"server":"https://matrix.puppygock.gay","version":"cowonduit 4.2.0-6.9"}` ``` https://matrix.puppygock.gay/client/server.json The version *should* be arbitrary, I can't think of any valid reason why it wouldn't be. If it isn't just take [matrix.org](https://slidingsync.lab.matrix.org/client/server.json)'s version Conduit still needs to resolve https://gitlab.com/famedly/conduit/-/issues/404 in addition to the other issue you mentioned for Element Web syncv3 to hopefully work properly.
lnicola commented 2023-11-26 12:35:11 +00:00 (Migrated from gitlab.com)

It's not that big of a deal. I use different domains for Element Web and the HS, and Element looks for that file under the former. I just plopped the JSON in there.

it is supposed to be sent by the proxy so it definitely would not be looking at Element Web's location

That's where it looks in my case.

It's not that big of a deal. I use different domains for Element Web and the HS, and Element looks for that file under the former. I just plopped the JSON in there. > it is supposed to be sent by the proxy so it definitely would not be looking at Element Web's location That's where it looks in my case.
Sign in to join this conversation.
No labels
Android
CS::needs customer feedback
CS::needs follow up
CS::needs on prem installation
CS::waiting
Chrome
Design:: Ready
Design:: in progress
Design::UX
E2EE
Edge
Firefox
GDPR
Iteration 13 IM
Linux
MacOS
Need::Discussion
Need::Steps to reproduce
Need::Upstream fix
Needs:: Planning
Needs::Dev-Team
Needs::More information
Needs::Priority
Needs::Product
Needs::Refinement
Needs::Severity
Priority::1-Critical
Priority::2-Max
Priority::3-Impending
Priority::4-High
Priority::5-Medium
Priority::6-Low
Priority::7-None
Progress::Backlog
Progress::Review
Progress::Started
Progress::Testing
Progress::Triage
Progress::Waiting
Reporter::Sentry
Safari
Target::Community
Target::Customer
Target::Internal
Target::PoC
Target::Security
Team:Customer-Success
Team:Design
Team:Infrastructure
Team:Instant-Messaging
Team:Product
Team:Workflows
Type::Bug
Type::Design
Type::Documentation
Type::Feature
Type::Improvement
Type::Support
Type::Tests
Windows
blocked
blocked-by-spec
cla-signed
conduit
contribution::advanced
contribution::easy
contribution::help needed
from::review
iOS
p::ti-tenant
performance
product::triage
proposal
refactor
release-blocker
s: dart_openapi_codegen
s::Famedly-Patient
s::Org-Directory
s::Passport-Generator
s::Requeuest
s:CRM
s:Famedly-App
s:Famedly-Web
s:Fhiroxide
s:Fhiroxide-cli
s:Fhiroxide-client
s:Fhirs
s:Hedwig
s:LISA
s:Matrix-Dart-SDK
s:Role-Manager
s:Synapse
s:User-Directory
s:WFS-Matrix
s:Workflow Engine
s:dtls
s:famedly-error
s:fcm-shared-isolate
s:matrix-api-lite
s:multiple-tab-detector
s:native-imaging
severity::1
severity::2
severity::3
severity::4
technical-debt
voip
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Matthias/conduit#400
No description provided.