-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat(backup): support file peeking [WPB-10575] #3261
feat(backup): support file peeking [WPB-10575] #3261
Conversation
Introduced `peekBackup` and related methods to retrieve backup metadata such as version, encryption status, and original creator. Also added unit tests to validate behavior for various cases, including unsupported versions and mismatched user IDs.
Test Results3 391 tests 3 284 ✅ 5m 3s ⏱️ Results for commit ec1d60b. ♻️ This comment has been updated with latest results. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## epic/multiplatform-backup #3261 +/- ##
============================================================
Coverage ? 54.03%
============================================================
Files ? 1246
Lines ? 36152
Branches ? 3656
============================================================
Hits ? 19533
Misses ? 15209
Partials ? 1410 Continue to review full report in Codecov by Sentry.
|
Datadog ReportBranch report: ✅ 0 Failed, 3284 Passed, 107 Skipped, 32.34s Total Time |
backup/src/commonMain/kotlin/com/wire/backup/ingest/MPBackupImporter.kt
Outdated
Show resolved
Hide resolved
Moved user ID validation logic out of the `peekBackup` method and into a separate suspend function in `BackupPeekResult.Success`. This improves separation of concerns and simplifies the `peekBackup` implementation across different platforms.
|
Introduced `peekBackup` and related methods to retrieve backup metadata such as version, encryption status, and original creator. Also added unit tests to validate behavior for various cases, including unsupported versions and mismatched user IDs.
* chore: create backup module (#3117) This commit introduces a new cross-platform backup module to the project with support for iOS, Web, and Android. Additionally, it enables JavaScript multiplatform support in existing `kalium/network-model` and `kalium/data` projects. * chore: create backup protobuf models (#3116) * feat: add initial crossplatform backup serialization [WPB-10575] (#3121) * feat: support other message types [WPB-10575] (#3122) Co-authored-by: Yamil Medina <[email protected]> * refactor(backup): make visibility modifier mandatory (#3153) * chore(backup): add encrypted stream [WPB-10575] (#3154) * chore(backup): read and write the backup header (#3159) * feat(backup): support export and import of backups on Web, iOS and Android [WPB-10575] (#3228) * refactor(backup): enhance error handling and test coverage (#3248) Refactored the backup import process to improve error handling by introducing more granular failure types and modularized the logic for decrypting and unzipping archives. Added comprehensive test coverage, including tests for edge cases in decryption, parsing, and unzipping. * chore(backup): improve backup export error handling and result encapsulation (#3257) Introduced `BackupExportResult` and `ExportResult` to encapsulate and represent export operation outcomes, including success and specific failure types (`IOError`, `ZipError`). Refactored relevant methods to use these types, added coroutine support annotations, and implemented error handling for zipping and I/O operations. Added unit tests to ensure correct error handling behavior. * feat(backup): support file peeking [WPB-10575] (#3261) Introduced `peekBackup` and related methods to retrieve backup metadata such as version, encryption status, and original creator. Also added unit tests to validate behavior for various cases, including unsupported versions and mismatched user IDs. * feat(backup): paginate different types of content (#3268) Consolidated handling of paginated backup data into the new `BackupPage` concept to improve clarity and support pagination for users, conversations, and messages during import. Added tests to validate the refactored `BackupImportPager`. * docs(backup): add multiplatform sample implementations and documentation (#3269) Introduced examples showcasing `MPBackupImporter` and `MPBackupExporter` usage for different platforms. Updated documentation, README, and build configurations to support multiplatform samples, including JS and non-JS targets. --------- Co-authored-by: Yamil Medina <[email protected]>
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
We need a way to peek into a file, to check if the file is using the new backup format or not, and learn more information about, like if it is encrypted or not.
This way the clients can decide which flow to follow, if falling back to older backup logic, asking the user for a password, etc.
Solutions
Add a function to the backup importer, that will take in data, attempt to parse it and return the relevant header data.
Testing
Test Coverage
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.