matrix-org / matrix-org/matrix-rust-sdk

Impossible to delete backups when they are only on the server

Open
#4,054 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.3k
Forks
500
Avg merge
1d 16h
Merged PRs (30d)
106

Description

In Fractal we are trying to enforce that cross-signing and recovery are fully set up. We basically offer to set it up if it doesn't exist, recover if it exists or reset it if the user does not have the recovery key. All that with the Recovery API.

Some users have been complaining that the options we provide do not work when a backup exists on the homeserver but we don't have the key locally (it is not in the secret storage and it was not sent by a device after verification). The recovery state is indeed always Disabled, whether the backup exists or not.

At first, we did not check if the backup was available on the server so when it was Disabled, we would always offer to enable it. That fails with this error: "A backup already exists on the homeserver and the method does not allow to overwrite it".

Then we decided to check if the backup exists on the server and we offer to "reset" it. We do that by calling disable then enable on the Recovery API. This also fails during the call to disable with the error: "backups are not enabled", which seems to come from Backups::disable.

So it looks like there is no way with the current Recovery API to fix that state. Should it call Backups::disable_and_delete? Or even better, should it have a "nuclear" reset method that we can call directly?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Recovery API calls into Backups::disable and the mentioned disable_and_delete path, then inspect how a server-only backup is represented when recovery is Disabled. Compare the reset behaviors described in the issue and check existing recovery and backup tests. Done means the API has a defined way to recover from this state, with tests covering the server-only backup case.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.