-
-
Notifications
You must be signed in to change notification settings - Fork 595
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't run migration for Rust crypto if the legacy store is empty
- Loading branch information
1 parent
b19817b
commit a9e3f28
Showing
5 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
spec/test-utils/test_indexeddb_cryptostore_dump/empty_account/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## Dump of an empty libolm indexeddb cryptostore to test skipping migration | ||
|
||
A dump of an account which is almost completely empty, and totally unsuitable | ||
for use as a real account. | ||
|
||
This dump was manually created by copying and editing full_account. | ||
|
||
Created to test | ||
["Unable to restore session" error due due to half-initialised legacy indexeddb crypto store #27447](https://github.com/element-hq/element-web/issues/27447). | ||
We should not launch the Rust migration code when we find a DB in this state. |
14 changes: 14 additions & 0 deletions
14
spec/test-utils/test_indexeddb_cryptostore_dump/empty_account/dump.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"account": [], | ||
"device_data": [], | ||
"inbound_group_sessions": [], | ||
"inbound_group_sessions_withheld": [], | ||
"notified_error_devices": [], | ||
"outgoingRoomKeyRequests": [], | ||
"parked_shared_history": [], | ||
"rooms": [], | ||
"session_problems": [], | ||
"sessions": [], | ||
"sessions_needing_backup": [], | ||
"shared_history_inbound_group_sessions": [] | ||
} |
31 changes: 31 additions & 0 deletions
31
spec/test-utils/test_indexeddb_cryptostore_dump/empty_account/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { DumpDataSetInfo } from "../index"; | ||
|
||
/** | ||
* A key query response containing the current keys of the tested user. | ||
* To be used during tests with fetchmock. | ||
*/ | ||
const KEYS_QUERY_RESPONSE: any = { | ||
device_keys: {}, | ||
master_keys: {}, | ||
self_signing_keys: {}, | ||
user_signing_keys: {}, | ||
}; | ||
|
||
/** | ||
* A `/room_keys/version` response containing the current server-side backup info. | ||
* To be used during tests with fetchmock. | ||
*/ | ||
const BACKUP_RESPONSE: any = {}; | ||
|
||
/** | ||
* A dataset containing the information for the tested user. | ||
* To be used during tests. | ||
*/ | ||
export const EMPTY_ACCOUNT_DATASET: DumpDataSetInfo = { | ||
userId: "@emptyuser:example.com", | ||
deviceId: "EMPTYDEVIC", | ||
pickleKey: "+/bcdefghijklmnopqrstu1/zyxvutsrqponmlkjih2", | ||
backupResponse: BACKUP_RESPONSE, | ||
keyQueryResponse: KEYS_QUERY_RESPONSE, | ||
dumpPath: "spec/test-utils/test_indexeddb_cryptostore_dump/empty_account/dump.json", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters