Manages the key backup.

Hierarchy

  • BackupManager

Constructors

Properties

algorithm: undefined | BackupAlgorithm
backupInfo: undefined | KeyBackupInfo
baseApis: MatrixClient
checkedForBackup: boolean
getKey: GetKey
sendingBackups: boolean
sessionLastCheckAttemptedTime: Record<string, number> = {}

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

  • 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>

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

    Throws an error if a problem is detected.

    Parameters

    Returns void

Generated using TypeDoc