element-hq / element-hq/element-ios

No actual way to use Jitsi Meet widget without auth in rooms

Open
#5,734 0 comments 0 reactions 0 assignees View on GitHub
A-Jitsi O-Frequent S-Minor T-Defect
Dominant language
Swift
Stars
1.8k
Forks
544
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

1. Join any Matrix room with "modify widget" power level set to 0 (any participant), and more than 2 participants (to make the client add Jitsi widget to the room)
2. Click "make a video call" button in the upper-right corner of the screen

### Outcome

#### What did you expect?

The call is initiated, just like in Element Android or Element Web

#### What happened instead?

You've get the "You need permission to manage conference call in this room" error message.

#### The cause

Take a look at [this code](https://github.com/vector-im/element-ios/blob/f7a816394741861cb34e5bc44f73350016ca0b29/Riot/Modules/Integrations/Widgets/Jitsi/JitsiService.swift#L130).

The logic _tries_ to be "if /.well-known/element/jitsi is 404, then additional Jitsi authentication is not needed".

But _actually_ it's "if there is a _fatal_ error in HTTP request then check the status code". As for me, I've tried the following (none worked):
- return non-existing content-type
- return content-type "application/json" with invalid JSON string
- return content-type "application/octet-stream" with valid JSON string
- empty response
- non-empty response
- all these things with 200 and a 404 return code
- set {"auth": ""}, {"auth": null}
- etc, etc...

Looks like there is no way to reach this only line that returns "noWellKnown" (and [subsequentially ](https://github.com/vector-im/element-ios/blob/f7a816394741861cb34e5bc44f73350016ca0b29/Riot/Modules/Integrations/Widgets/Jitsi/JitsiService.swift#L156)to "so no auth is needed" later), because, well, if MXHTTPClient gets any response than it's a _huge success_.

### Your phone model

iPhone Xr

### Operating system version

iOS 15.3.1

### Application version

Element 1.8.3

### Homeserver

Synapse 1.51.0, Jitsi-Meet Web 1.0.5818

### Will you send logs?

No

Contributor guide

Open the contributing guide

Research direction

Start in Riot/Modules/Integrations/Widgets/Jitsi/JitsiService.swift around lines 130 and 156, then reproduce the room scenario with modify-widget power level 0 and more than two participants. Trace how MXHTTPClient handles the /.well-known/element/jitsi response and compare the intended no-auth path with the permission error. Done means the call starts without requiring room widget-management permission, as on Element Android and Web.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.