element-hq / element-hq/element-web
If publishing the cross-signing keys fails, we give up trying but we should keep trying
- Dominant language
- TypeScript
- Stars
- 13.5k
- Forks
- 2.8k
- PR merge metrics
- PR metrics pending
Description
When first logging in on a new account, we try to publish cross-signing keys (via `/device_keys/upload`).
This process can fail for example, if the homeserver is configured to use SSO auth. (Publishing the public keys requires user-interactive auth, which may fail. https://github.com/matrix-org/matrix-spec-proposals/pull/3967 is an attempt to help with that, ~~but is as yet unstandardised~~. Edit 2024-06-11: It is now standardised, and https://github.com/element-hq/synapse/pull/17284 lands support for it in Synapse.)
If the process fails (either because the HS rejects it or the user gets bored of trying to do UIA), we show an error:

After that point, the application is fully-functional, and will even allow you to set up 4S and store the *private* cross-signing keys in 4S. The problem is that there is no further attempt to publish the public keys, so the account is now totally broken until the user resets cross-signing.
Contributor guide
Research direction
The issue identifies the first-login cross-signing flow and the /device_keys/upload endpoint as entry points. Start by tracing how a failed upload is handled after UIA or homeserver rejection; done means a later retry can publish the public keys without forcing a cross-signing reset.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- authentication, frontend, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100