File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { StoreType as RustSdkCryptoStoreType } from "@matrix-org/matrix-sdk-cryp
11
11
import { ICryptoStorageProvider } from "./ICryptoStorageProvider" ;
12
12
import { IAppserviceCryptoStorageProvider } from "./IAppserviceStorageProvider" ;
13
13
import { ICryptoRoomInformation } from "../e2ee/ICryptoRoomInformation" ;
14
+ import { LogService } from "../logging/LogService" ;
14
15
15
16
export { RustSdkCryptoStoreType } ;
16
17
@@ -59,10 +60,12 @@ export class RustSdkCryptoStorageProvider implements ICryptoStorageProvider {
59
60
// No machine files at all, we can skip.
60
61
return newPath ;
61
62
}
62
-
63
+ const legacyDeviceId = await this . getDeviceId ( ) ;
63
64
// We need to move the file.
64
- await mkdir ( newPath ) ;
65
- await rename ( legacyFilePath , path . join ( newPath , 'matrix-sdk-crypto.sqlite3' ) ) ;
65
+ const previousDevicePath = path . join ( this . storagePath , sha256 ( ) . update ( legacyDeviceId ) . digest ( 'hex' ) ) ;
66
+ LogService . warn ( "RustSdkCryptoStorageProvider" , `Migrating path for SDK database for legacy device ${ legacyDeviceId } ` ) ;
67
+ await mkdir ( previousDevicePath ) ;
68
+ await rename ( legacyFilePath , path . join ( previousDevicePath , 'matrix-sdk-crypto.sqlite3' ) ) ;
66
69
return newPath ;
67
70
}
68
71
You can’t perform that action at this time.
0 commit comments