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

  • Parameters

    • senderKey: string
    • sessionId: string

    Returns Promise<void>

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

  • Check the server for an active key backup and if one is present and has a valid signature from one of the user's verified devices, start backing up to it.

    Returns Promise<null | IKeyBackupCheck>

  • 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

    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

    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>

  • Check if the given backup info is trusted.

    Returns

    { usable: [bool], // is the backup trusted, true iff there is a sig that is valid & from a trusted device sigs: [ valid: [bool || null], // true: valid, false: invalid, null: cannot attempt validation deviceId: [string], device: [DeviceInfo || null], ] }

    Parameters

    • Optional backupInfo: IKeyBackupInfo

      key backup info dict from /room_keys/version

    Returns Promise<TrustInfo>

  • 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