Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recovery: Fix the recovery state not being updated after backups are enabled via secret send #3623

Merged
merged 3 commits into from
Jul 1, 2024

Commits on Jul 1, 2024

  1. Configuration menu
    Copy the full SHA
    81bfec3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4f6a173 View commit details
    Browse the repository at this point in the history
  3. recovery: Ensure that we don't miss updates to the backup state

    This patch switches the way we update the recovery state upon changes in
    the backup state. Previously two places updated the recovery state after
    the backup state changed:
    
        1. A method living in the recovery subsystem that the backup
           subsystem itself calls.
        2. An event handler which is called when we receive a m.secret.send
           event.
    
    The first method is a hack because it introduces a circular dependency
    between the recovery and backup subsystems.
    
    More importantly, the second method can miss updates, because the backup
    subsystem has a similar event handler which then processes the secret we
    received and if the secret was a backup recovery key, enables backups.
    
    Depending on the order these event handlers are called, the recovery
    subsystem might update the recovery state before the secret has been
    handled.
    
    The backup subsystem provides an async stream which broadcasts updates
    to the backup state, letting the recovery subsystem listen to this
    stream and update its state if we notice such updates fixes both
    problems we listed above. The method in the first bullet point was
    completely removed, the event handler is kept for other secret types but
    we don't rely on it for the backup state anymore.
    poljar committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    44a4505 View commit details
    Browse the repository at this point in the history