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

Disabling and recreating key backup on Web leaves the SDK (EX) in a weird state.

Open
#4,190 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

The SDK detects when the backup is disabled, when re-enabling it, it believes it is enabled until you try to send a message (or maybe receive one that needs to open the key backup?) at which point it believes the backup is disabled again. Choosing to enable the backup fails with

```
2024-10-30T12:38:16.481302Z ERROR elementx: Failed enabling secure backup with error: BackupExistsOnServer | SecureBackupController.swift:91 | spans: root
2024-10-30T12:38:16.482975Z ERROR elementx: Failed enabling key backup with error: failedEnablingBackup | SecureBackupScreenViewModel.swift:77 | spans: root⁦
```

Recording of 2 webs + an EX showing this and how it is handled differently.

https://github.com/user-attachments/assets/c5d2906e-b1e2-4f3f-bc8c-573f1b3ad15a

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 inspecting the secure-backup flow around SecureBackupController.swift:91 and SecureBackupScreenViewModel.swift:77, then trace how the SDK represents a disabled and recreated backup. Reproduce the sequence shown in the recording and verify that re-enabling succeeds without the SDK reverting to a disabled state when sending or receiving a message.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, swift
Domain
security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.