element-hq / element-hq/element-android

Modular custom widget: Matrix Widget API handshake never completes on Android (works in Element Web)

Open
#9,134 0 comments 0 reactions 0 assignees View on GitHub
T-Defect
Dominant language
Kotlin
Stars
3.7k
Forks
917
PR merge metrics
No merged PRs in 30d

Description

### Steps to reproduce

1. Use a private room where the bot registered a custom modular widget (`im.vector.modular.widgets`): type `m.custom`, HTTPS iframe URL on our infrastructure, stable `widgetId` matching the store integration.
2. On Element Android (classic app), open the room and launch the Store widget.
3. Observe: the widget iframe loads (our embedded diagnostics show the client JS starts) but the session never becomes authenticated / the UI stays stuck.

Control: In the same account and room, open Element in a desktop browser (Element Web). The same widget completes the Widget API flow and works.

We also tested room state with `waitForIframeLoad: false` (widget sends ContentLoaded) and with `waitForIframeLoad: true` (widget does not send ContentLoaded). Android still fails after ~25s with handshake timeout in both cases. Element Web works in the same scenarios.

### Outcome

#### What did you expect?
The Android app should complete the Matrix Widget API handshake with the iframe (parent ↔ widget `postMessage` traffic), allowing OpenID / session bootstrap like Element Web does for the same room and widget.

#### What happened instead?
On Android, the widget side starts but the client never completes the handshake. After about 25 seconds our integration reports handshake timeout and auth/bootstrap fails.

Our server-side widget diagnostics (no secrets logged) show no parent-origin Widget API traffic on Android, while the same session from Element Web shows normal widget API message exchange and successful bootstrap.

This appears consistent with Android WebView / widget host issues for custom iframe widgets (see also discussion around #7996).

### Your phone model

Samsung Galaxy A54

### Operating system version

Android version from Settings → Android 14

### Application version and app store → Element 1.6.52, Google Play

Element version from Settings → Help & About>, from

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.