Manages the key backup.

Hierarchy

  • BackupManager

Constructors

Properties

algorithm: undefined | BackupAlgorithm
backupInfo: undefined | IKeyBackupInfo
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.

    Returns

    Number of sessions backed up

    Parameters

    • limit: number

      Maximum number of keys to back up

    Returns Promise<number>

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

    Returns

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

    Returns Promise<null | IKeyBackupCheck>

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

    Returns

    Promise which resolves to the number of sessions requiring backup

    Returns Promise<number>

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

    Returns

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

    Returns Promise<number>

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

Generated using TypeDoc