-
Notifications
You must be signed in to change notification settings - Fork 216
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
Import progress for room keys with Crypto V2 #1637
Conversation
e7f7008
to
e5dd8d3
Compare
Codecov ReportBase: 16.02% // Head: 36.15% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #1637 +/- ##
============================================
+ Coverage 16.02% 36.15% +20.12%
============================================
Files 583 583
Lines 92528 92556 +28
Branches 39030 40240 +1210
============================================
+ Hits 14830 33463 +18633
+ Misses 77213 58088 -19125
- Partials 485 1005 +520
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IGTM!
@@ -362,6 +382,10 @@ class MXCryptoKeyBackupEngine: NSObject, MXKeyBackupEngine { | |||
return try backup.exportRoomKeys(passphrase: passphrase) | |||
} | |||
|
|||
func importProgress() -> Progress? { | |||
return activeImportProgress |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return activeImportProgress | |
activeImportProgress |
Split up room keys into batches of 1000 when importing, and ensure to decrypt + import within
autoreleasepool
. This ensures we do not run out of memory when importing large key backups.Additionally expose
importProgress
property, analogous to existingbackupProgress
, that can be used by any UI.Tested by importing 1,000,000 keys on a device, which does grow the memory footprint considerably, but still slower than without the
autoreleasepool
and batching. The initial spike seen below is the http request, roughly 800MB for all the keys.