mirror of
https://github.com/bitwarden/clients.git
synced 2026-11-16 07:03:29 +00:00
Add SdkService.cryptoReady$ and key KeyService.cipherDecryptionKeys$ on it. USER_KEY in state only says that a key exists. The SDK writes it partway through unlock, before setOrgKeys has run, so a consumer keyed on state starts decrypting against a client that fails every organization cipher. While the client is not ready, non-null keys are held back and null is passed through, so a lock still reaches consumers right away. This gates every lock and unlock cycle, and firstValueFrom(orgKeys$) still resolves to null while locked. DefaultSdkService.cryptoReady$ is always true for now: per-user clients are rebuilt from the same state consumers read, so there is no window. The long-lived client wires the transitions into the push methods.
Key management
This lib represents the public API of the Key management team at Bitwarden. Modules are imported using @bitwarden/key-management.