-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
5 changed files
with
71 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters