matrix-react-sdk icon indicating copy to clipboard operation
matrix-react-sdk copied to clipboard

Improve handling of encryption key that is not available

Open ReneHollander opened this issue 4 years ago • 1 comments

I am trying to fix https://github.com/vector-im/element-desktop/issues/688 and came up with the following: https://github.com/ReneHollander/matrix-react-sdk/commit/a6caf946c960c159be740f0039e0d836bf4bb85b
This approach is less then ideal as there being no key in the Keyring (e.g the user reset the keyring) would lead to Element being stuck in an endless loading loop at startup without any indication what's going on (see [1]).

I am not too familiar with the codebase and I am wondering if a more experienced maintainer can give me a hint or two on how to implement this properly. I would have the following idea:

  • Start the app normally and display a banner that the encryption could not be loaded from the system keyring. Explain that it might need to be unlocked first.
  • Fix the message shown to the user to not be so confusing as it mentions no connection to the server could be made, even though just the keyring isn't unlocked: image
  • Have element try to poll for the encryption key and reload the app once it's available to regain connection and decrypt the messages and remove the banner.

Alternatively maybe on the intitial loading page [1] that would persist until the key is found add a message that it's waiting on the encryption key to be available. This might be easier to implement.

[1] Screen shown while trying to get the encryption key: image


Here's what your changelog entry will look like:

🐛 Bug Fixes

  • Improve handling of encryption key that is not available (#7020). Fixes vector-im/element-desktop#688. Contributed by @ReneHollander.

ReneHollander avatar Oct 23 '21 13:10 ReneHollander

Related to https://github.com/matrix-org/matrix-react-sdk/pull/8272

MadLittleMods avatar Jun 01 '22 23:06 MadLittleMods