X-signing: error message and prompt to enable MAS temporary key reset doesn't display for ~20 seconds
Steps to reproduce
- Where are you starting? What can you see? Element Web on Chromium
- What do you click? In settings, key reset
- 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
The slowness here is due to https://github.com/matrix-org/matrix-js-sdk/pull/4061
What exactly is the error code returned by /keys/upload? The retry logic should only retry after HTTP 500 errors and the like.
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
Per the discussion on https://github.com/matrix-org/matrix-js-sdk/pull/4061, I don't think that's correct