element-hq / element-hq/element-x-android

Element Call fails with OPEN_ID_ERROR but no OpenID request is sent

Open
#7,120 21 comments 0 reactions 0 assignees View on GitHub
T-Other Z-Element Call
Dominant language
Kotlin
Stars
2.4k
Forks
624
Avg merge
1d 14h
Merged PRs (30d)
149

Description

### Steps to reproduce

1. Use a self-hosted Synapse homeserver.
2. Upgrade the homeserver from Synapse `1.136` to Synapse `1.151`.
3. Configure MatrixRTC / Element Call with a separate LiveKit server and `lk-jwt-service`.
4. Configure MatrixRTC discovery through both:
- `/.well-known/matrix/client`
- Synapse `matrix_rtc.transports`
5. Confirm that desktop web clients can use Element Call successfully.
6. Confirm that a mobile browser using the self-hosted Element Call frontend can also use the same Element Call / LiveKit deployment successfully.
7. On Element X Android, log in with an affected account on the same homeserver.
8. Open a room and start or join an Element Call.
9. Element X Android fails with `OPEN_ID_ERROR`, or enters the call screen but stays stuck on `Waiting for media`.
10. Check the homeserver reverse proxy logs during the failing attempt.

**Observed server-side behavior**

During the failing Element X Android attempt, the client still contacts the homeserver normally.

The homeserver receives requests such as:

- `GET /.well-known/matrix/client`
- `GET /_matrix/client/v3/profile/...`
- `GET /_matrix/client/v3/rooms/.../members`
- `POST /_matrix/client/unstable/org.matrix.simplified_msc3575/sync`
- other normal sync/profile/member requests

However, during the failing Element X Android attempt, the homeserver does **not** receive this request:

- `POST /_matrix/client/v3/user/{userId}/openid/request_token`

The homeserver also does **not** receive the expected MatrixRTC call membership event from the failing Android client.

By contrast, when the same call is joined from desktop web or from the mobile browser Element Call frontend:

- the OpenID request is sent successfully
- the JWT service validates it successfully
- the MatrixRTC call membership event is sent
- the call works

**Observed client-side behavior**

Element X Android shows either:

- `OPEN_ID_ERROR`
- or `Waiting for media`

Relevant Element X log messages include:

- `[ElementCall] [LocalTransport] Failed to authenticate to transport ... {"code":"OPEN_ID_ERROR"}`
- `[CallViewModel][LocalMembership] Multiple Transport Errors`
- `Uncaught Error: Something went wrong`

**Important detail**

The error shown in the UI is `OPEN_ID_ERROR`, but based on homeserver access logs, the OpenID request is not failing on the server side.

It appears that Element X Android never sends the OpenID token request at all during the failing attempt.

This makes me suspect the issue may be in the Element X Android / embedded Element Call / WebView OpenID bridge path, rather than in the Synapse OpenID endpoint itself.

### Outcome

#### What did you expect?

Element X Android should request an OpenID token from the homeserver by calling:

`POST /_matrix/client/v3/user/{userId}/openid/request_token`

Then it should pass the OpenID token to the configured LiveKit JWT service, receive LiveKit credentials, publish the MatrixRTC call membership event, and join the Element Call successfully.

#### What happened instead?

Element X Android fails with `OPEN_ID_ERROR` or gets stuck on `Waiting for media`.

The homeserver logs show that the OpenID request is not sent by Element X Android during the failing attempt.

Desktop web clients and the mobile browser Element Call frontend can use the same homeserver, same room, same LiveKit server, and same JWT service successfully.

**Additional context**

- The issue started after upgrading Synapse from `1.136` to `1.151`.
- The reverse proxy was also upgraded around the same time.
- The current MatrixRTC / LiveKit setup works from web clients.
- The Synapse OpenID endpoint works when used by desktop web Element Call.
- The LiveKit JWT service works when used by desktop web Element Call.
- The problem appears to be specific to Element X Android for some accounts/sessions.
- Clearing cache did not fix the issue.
- The issue reproduces on both Element X Android `26.06.4` and `26.05.2`.
- A mobile browser on the same phone can use the self-hosted Element Call frontend successfully.

### Your phone model

Samsung S23 / Samsung S23+

### Operating system version

Android 16

### Application version and app store

Element X Android `26.06.4`

### Homeserver

Self-hosted Synapse `1.151` The homeserver was upgraded from Synapse `1.136`. MatrixRTC / MSC4143 is enabled. Element Call is configured with a separate LiveKit server and `lk-jwt-service`.

### Will you send logs?

Yes

### Are you willing to provide a PR?

No

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure in Element X Android while monitoring reverse-proxy logs, focusing on the embedded Element Call/WebView OpenID bridge and the POST /_matrix/client/v3/user/{userId}/openid/request_token entry point. Compare the failing Android flow with the working desktop and mobile-browser flows; done means the OpenID request, MatrixRTC membership event, and call join complete without OPEN_ID_ERROR or Waiting for media.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
audio-video-rtc, authentication, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.