Manages the key backup.

Constructors

Properties

backupInfo: undefined | KeyBackupInfo
checkedForBackup: boolean
getKey: GetKey

Accessors

Methods

  • Take some e2e keys waiting to be backed up and send them to the backup.

    Parameters

    • limit: number

      Maximum number of keys to back up

    Returns Promise<number>

    Number of sessions backed up

  • Forces a re-check of the key backup and enables/disables it as appropriate.

    Returns Promise<null | IKeyBackupCheck>

    Object with backup info (as returned by getKeyBackupVersion) in backupInfo and trust information (as returned by isKeyBackupTrusted) in trustInfo.

  • Counts the number of end to end session keys that are waiting to be backed up

    Returns Promise<number>

    Promise which resolves to the number of sessions requiring backup

  • Deletes all key backups.

    Will call the API to delete active backup until there is no more present.

    Returns Promise<void>

  • Marks all group sessions as needing to be backed up without scheduling them to upload in the background.

    Returns Promise<number>

    Promise which resolves to the number of sessions now requiring a backup (which will be equal to the number of sessions in the store).

  • Attempts to retrieve a session from a key backup, if enough time has elapsed since the last check for this session id.

    Parameters

    • targetRoomId: undefined | string
    • targetSessionId: undefined | string

    Returns Promise<void>

  • Marks all group sessions as needing to be backed up and schedules them to upload in the background as soon as possible.

    Returns Promise<void>

  • Schedules sending all keys waiting to be sent to the backup, if not already scheduled. Retries if necessary.

    Parameters

    • maxDelay: number = 10000

      Maximum delay to wait in ms. 0 means no delay.

    Returns Promise<void>

  • Stop the backup manager from backing up keys and allow a clean shutdown.

    Returns void

  • Performs a quick check to ensure that the backup info looks sane.

    Throws an error if a problem is detected.

    Parameters

    Returns void