Resumable backup import

This commit is contained in:
Fedor Indutny 2024-08-27 17:00:41 -04:00 committed by GitHub
parent 3d8aaf0a5a
commit 8ef149e3a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 498 additions and 33 deletions

View file

@ -62,6 +62,8 @@ import { SignalService as Proto } from '../protobuf';
import * as log from '../logging/log';
import type { StorageAccessType } from '../types/Storage';
import { linkDeviceRoute } from '../util/signalRoutes';
import { getRelativePath, createName } from '../util/attachmentPath';
import { isBackupEnabled } from '../util/isBackupEnabled';
type StorageKeyByServiceIdKind = {
[kind in ServiceIdKind]: keyof StorageAccessType;
@ -1271,6 +1273,9 @@ export default class AccountManager extends EventTarget {
const regionCode = getRegionCodeForNumber(number);
await storage.put('regionCode', regionCode);
if (isBackupEnabled()) {
await storage.put('backupDownloadPath', getRelativePath(createName()));
}
await storage.protocol.hydrateCaches();
const store = storage.protocol;