-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export_room_keys fails on big database #2914
Comments
ftr importing large numbers of keys also fails: https://github.com/vector-im/element-web/issues/26692 |
I can reproduce this in my local dev environment, when I have a lot of keys. I see a failure inside:
On the IndexedDb object store. The error message I see is:
|
Here is the stack of calls:
Everything after So in the Rust case we create a |
For future reference, we could base a fully-streaming solution on https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream but it is not currently supported in Safari. For now, we will focus on creating a |
I will consider |
The most obvious thing to fix first is the fact that the Rust converts the key backup to JSON, and the JS wrapper parses that to return it, only for it to be re-stringified immediately afterwards by the code shared between legacy and Rust crypto. |
These PRs together avoid the deserialise-reserialise dance on export and import:
|
Now I will focus on generating the |
Also, and probably a better idea, we implement the same encryption in the Rust code at https://github.com/matrix-org/matrix-rust-sdk/blob/main/crates/matrix-sdk-crypto/src/file_encryption/key_export.rs#L137 so it would be good to re-use this implementation. I note that the current Rust code also makes several copies for encryption, base64 encoding etc. so swapping to use it probably won't fix the problem, but it will mean we re-use more cod. |
OK, we have confirmation that an export succeeded, so we consider the fixes we've done so far to be adequate. Ideally, we'd make a fully-scalable solution but we are not going to work more on that now. |
see element-hq/element-web#26681
=> Current code tries to extract all inbound session in a single session. In case of big accounts probably room
The text was updated successfully, but these errors were encountered: