element-x-ios icon indicating copy to clipboard operation
element-x-ios copied to clipboard

Unable to accept or decline invites without MSC3266 enabled

Open bban160 opened this issue 1 year ago • 7 comments

Steps to reproduce

  1. Ensure experimental.msc3266_enabled is set to false in Synapse configuration (the default)
  2. Invite user to a room
  3. User tries to accept (or decline) invite
  4. "Sorry, an error occurred"

Outcome

What did you expect?

Successfully joining the room

What happened instead?

"Sorry, an error occurred"

Your phone model

iPhone 16

Operating system version

iOS 18.2.1

Application version

Version 1.9.9 (140)

Homeserver

Synapse 1.122.0

Logs

2025-01-28T20:04:13.368488Z DEBUG matrix_sdk::http_client::native: Sending request num_attempt=1 | crates/matrix-sdk/src/http_client/native.rs:55 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-58" method=GET uri="https://matrix.redacted/_matrix/client/unstable/im.nheko.summary/rooms/!uMzcavxvIIPIQUIVCI:redacted/summary"}

2025-01-28T20:04:13.524942Z DEBUG matrix_sdk::http_client: Error while sending request: Api(Server(ClientApi(Error { status_code: 404, body: Standard { kind: Unrecognized, message: "Unrecognized request" } }))) | crates/matrix-sdk/src/http_client/mod.rs:234 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-58" method=GET uri="https://matrix.redacted/_matrix/client/unstable/im.nheko.summary/rooms/!uMzcavxvIIPIQUIVCI:redacted/summary" status=404 response_size="59 B"}

2025-01-28T20:04:13.525714Z DEBUG matrix_sdk::http_client::native: Sending request num_attempt=1 | crates/matrix-sdk/src/http_client/native.rs:55 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-59" method=POST uri="https://matrix.redacted/_matrix/client/v3/publicRooms" request_size="13 B"}

2025-01-28T20:04:13.565978Z DEBUG matrix_sdk::http_client: Got response | crates/matrix-sdk/src/http_client/mod.rs:230 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-59" method=POST uri="https://matrix.redacted/_matrix/client/v3/publicRooms" request_size="13 B" status=200 response_size="388 B"}

2025-01-28T20:04:13.566659Z DEBUG matrix_sdk::http_client::native: Sending request num_attempt=1 | crates/matrix-sdk/src/http_client/native.rs:55 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-60" method=GET uri="https://matrix.redacted/_matrix/client/v3/rooms/!uMzcavxvIIPIQUIVCI:redacted/state"}

2025-01-28T20:04:13.568564Z DEBUG matrix_sdk::http_client::native: Sending request num_attempt=1 | crates/matrix-sdk/src/http_client/native.rs:55 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-61" method=GET uri="https://matrix.redacted/_matrix/client/v3/rooms/!uMzcavxvIIPIQUIVCI:redacted/joined_members"}

2025-01-28T20:04:13.606813Z DEBUG matrix_sdk::http_client: Error while sending request: Api(Server(ClientApi(Error { status_code: 403, body: Standard { kind: Forbidden { authenticate: None }, message: "User @username:redacted not in room !uMzcavxvIIPIQUIVCI:redacted, and room previews are disabled" } }))) | crates/matrix-sdk/src/http_client/mod.rs:234 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-60" method=GET uri="https://matrix.redacted/_matrix/client/v3/rooms/!uMzcavxvIIPIQUIVCI:redacted/state" status=403 response_size="152 B"}

2025-01-28T20:04:13.608855Z ERROR elementx: Failed retrieving room: !uMzcavxvIIPIQUIVCI:redacted, with error: Generic(msg: "the server returned an error: [403 / M_FORBIDDEN] User @username:redacted not in room !uMzcavxvIIPIQUIVCI:redacted, and room previews are disabled") | ClientProxy.swift:956 | spans: root

2025-01-28T20:04:13.612471Z DEBUG matrix_sdk::http_client::native: Sending request num_attempt=1 | crates/matrix-sdk/src/http_client/native.rs:55 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-62" method=GET uri="https://matrix.redacted/_matrix/client/unstable/im.nheko.summary/rooms/!uMzcavxvIIPIQUIVCI:redacted/summary"}

2025-01-28T20:04:13.759416Z DEBUG matrix_sdk::http_client: Error while sending request: Api(Server(ClientApi(Error { status_code: 404, body: Standard { kind: Unrecognized, message: "Unrecognized request" } }))) | crates/matrix-sdk/src/http_client/mod.rs:234 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-62" method=GET uri="https://matrix.redacted/_matrix/client/unstable/im.nheko.summary/rooms/!uMzcavxvIIPIQUIVCI:redacted/summary" status=404 response_size="59 B"}

2025-01-28T20:04:13.759667Z DEBUG matrix_sdk::http_client::native: Sending request num_attempt=1 | crates/matrix-sdk/src/http_client/native.rs:55 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-63" method=POST uri="https://matrix.redacted/_matrix/client/v3/publicRooms" request_size="13 B"}

2025-01-28T20:04:13.801599Z DEBUG matrix_sdk::http_client: Got response | crates/matrix-sdk/src/http_client/mod.rs:230 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-63" method=POST uri="https://matrix.redacted/_matrix/client/v3/publicRooms" request_size="13 B" status=200 response_size="388 B"}

2025-01-28T20:04:13.801916Z DEBUG matrix_sdk::http_client::native: Sending request num_attempt=1 | crates/matrix-sdk/src/http_client/native.rs:55 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-64" method=GET uri="https://matrix.redacted/_matrix/client/v3/rooms/!uMzcavxvIIPIQUIVCI:redacted/state"}

2025-01-28T20:04:13.802104Z DEBUG matrix_sdk::http_client::native: Sending request num_attempt=1 | crates/matrix-sdk/src/http_client/native.rs:55 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-65" method=GET uri="https://matrix.redacted/_matrix/client/v3/rooms/!uMzcavxvIIPIQUIVCI:redacted/joined_members"}

2025-01-28T20:04:13.842757Z DEBUG matrix_sdk::http_client: Error while sending request: Api(Server(ClientApi(Error { status_code: 403, body: Standard { kind: Forbidden { authenticate: None }, message: "User @username:redacted not in room !uMzcavxvIIPIQUIVCI:redacted, and room previews are disabled" } }))) | crates/matrix-sdk/src/http_client/mod.rs:234 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 0 } request_id="REQ-64" method=GET uri="https://matrix.redacted/_matrix/client/v3/rooms/!uMzcavxvIIPIQUIVCI:redacted/state" status=403 response_size="152 B"}

2025-01-28T20:04:13.843669Z ERROR elementx: Failed retrieving room: !uMzcavxvIIPIQUIVCI:redacted, with error: Generic(msg: "the server returned an error: [403 / M_FORBIDDEN] User @username:redacted not in room !uMzcavxvIIPIQUIVCI:redacted, and room previews are disabled") | ClientProxy.swift:956 | spans: root

bban160 avatar Jan 28 '25 21:01 bban160

EX heavily depends on the Room Summary API. It is mandatory to have it enabled on Synapse.

manuroe avatar Jan 29 '25 08:01 manuroe

Hi @manuroe,

Element X Android does not require this API or at least does not fail catastrophically when it is disabled. This is an issue specific to Element X iOS.

Furthermore, I don't see why the Room Summary API should be mandatory for accepting invites. I understand why it is useful for richer rendering of invites in the room list, but I don't understand how it is relevant after the user has already chosen to accept or decline.


In any case, seeing as the Room Summary API is not yet part of the spec, reliant on an unstable prefix, and not enabled by default in Synapse, may I ask if it is documented somewhere that it is required for Element X iOS? If there are any other unstable APIs required for Element X iOS (or Android), I would like to know about those as well.

bban160 avatar Jan 29 '25 22:01 bban160

Which of the screens are we actually talking about here? We show invites on the room list from where the user can tap on them and get more info. Presumably it's this step that fails but there are action buttons for accepting/decling on both.

I see http preview failures in your logs but can't the user accept the invite from the room list?

stefanceriu avatar Jan 30 '25 06:01 stefanceriu

Hi @stefanceriu,

The user cannot accept or decline the invite if MSC3266 is disabled. The provided logs are from after the user taps the accept button, which is why I was not sure why the Room Summary API is being called here at all.

I have not tested how Element X iOS or Element X Android behave when tapping on the invite for more info. This issue is strictly about the action of accepting or declining an invite failing catastrophically.

bban160 avatar Jan 30 '25 07:01 bban160

Well I can see two possibilities:

  1. Your user didn't actually tap on any of the action buttons in the room list and instead tried to go preview the invite.

  2. The client tries to fetch the invite room through the sdk before accepting the invite and that's what fails, but then I would expect the same behavior on both platforms.

stefanceriu avatar Jan 30 '25 07:01 stefanceriu

Hi @stefanceriu,

I tested this myself on both platforms before opening an issue. The logs are generated and retrieved by me, not by anyone else. I know for certain that I tapped squarely on the Accept/Decline buttons, and I reproduced the described behavior several times on both platforms and with MSC3266 both enabled and disabled.

After tapping "Accept", Element X iOS ~~switches to a different screen (probably the preview screen that you mentioned), then returns to the room list, then~~ displays the "Sorry, an error occurred" popup. Case 2 certainly sounds plausible. ~~Perhaps on Android, tapping "Accept" does not actually trigger the preview like on iOS? I am not familiar with either codebase so this is only speculation on my part.~~

If I have a chance I will do some more testing to reconfirm everything.

bban160 avatar Jan 30 '25 09:01 bban160

Hi @stefanceriu, I have retested the behavior on both platforms when MSC3266 is disabled:

Element X iOS

Tapping "Accept" or "Decline" from the room list directly brings up the "Sorry, an error occurred" popup. There is no change in screens as I incorrectly stated earlier.

Tapping the invite outside the action buttons brings up the preview screen, which says "Preview is not available" (as shown below) but does not fail catastrophically. The preview screen, however, is the version used for joining public rooms from the room directory ("Join room" button) rather than the correct version for invites ("Decline"/"Accept" buttons). From the preview, incorrect as it may be, tapping "Join room" does successfully join the room with no visible error message.

Element X Android

Tapping "Accept" from the room list successfully joins the room and brings up the timeline for the room.

Tapping "Decline" from the room list brings up a confirmation prompt. Tapping "Decline" again in the confirmation prompt does nothing and fails silently. This is contrary to my previous assumption that Element X Android is perfectly functional even with MSC3266 disabled, and I will open a separate bug report in the Element X Android repo for this.

Tapping the invite outside the action buttons brings up the preview screen, which correctly displays the room title and inviter (as shown below). Tapping "Accept" or "Decline" from the preview has the exact same behavior as the respective action buttons in the room list.

Preview UIs

MSC3266 Element X iOS Element X Android
❌ Disabled Element X iOS with MSC3266 disabled Element X Android with MSC3266 disabled
✅ Enabled Element X iOS with MSC3266 disabled Element X Android with MSC3266 enabled

It should be noted that Element X iOS correctly displays the room title and inviter in the room list even when MSC3266 is disabled. The Room Summary API is not required to fetch this data for invitations.

bban160 avatar Jan 31 '25 05:01 bban160

Seems this was fixed by those commits but didn't get closed automatically.

pixlwave avatar Sep 19 '25 10:09 pixlwave