element-web icon indicating copy to clipboard operation
element-web copied to clipboard

X-signing: error message and prompt to enable MAS temporary key reset doesn't display for ~20 seconds

Open wrjlewis opened this issue 1 year ago • 4 comments

Steps to reproduce

  1. Where are you starting? What can you see? Element Web on Chromium
  2. What do you click? In settings, key reset
  3. More steps… Go through the cross signing key reset flow, which will eventually fail and show an error message, prompting the user to enable key reset temporarily within MAS

That error message takes up to 20 seconds to display, while a loading icon spins, and in the background numerous attempts to /upload fail

Outcome

What did you expect?

The error message to appear within an acceptable period, within a couple seconds?

What happened instead?

It retries the failing upload request so many times that the error doesn't appear for 20 or so seconds, at which point the user would have probably given up already.

What would be great?

If the error message appeared more quickly, and there is an option to 'retry' once the user has enabled the option in MAS to allow key-resetting.

Operating system

MacOS

Browser information

Version 1.52.0 (51895) Chromium Engine Version 126.0.6478.183

URL for webapp

element.elementdemo.will (local ESS install)

Application version

Element version: 1.11.69 Crypto version: Rust SDK 0.7.0 (068a0af), Vodozemac 0.6.0

Homeserver

No response

Will you send logs?

No

wrjlewis avatar Jul 26 '24 13:07 wrjlewis

The slowness here is due to https://github.com/matrix-org/matrix-js-sdk/pull/4061

t3chguy avatar Jul 31 '24 15:07 t3chguy

What exactly is the error code returned by /keys/upload? The retry logic should only retry after HTTP 500 errors and the like.

richvdh avatar Jul 31 '24 15:07 richvdh

The PR makes it retry on anything that is !res.ok as far as I can tell. It is relying on http-api/fetch to make the distinction by throwing when !ok - it lost its status code filtering during review.

Fetch ok only considers statuses in the 200-299 range: https://developer.mozilla.org/en-US/docs/Web/API/Response/ok

t3chguy avatar Jul 31 '24 15:07 t3chguy

Per the discussion on https://github.com/matrix-org/matrix-js-sdk/pull/4061, I don't think that's correct

richvdh avatar Aug 01 '24 09:08 richvdh