Skip to content
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

chore: add multiplatform backup module [WPB-10575] #3279

Merged
merged 14 commits into from
Feb 7, 2025

Conversation

vitorhugods
Copy link
Member

@vitorhugods vitorhugods commented Feb 6, 2025

StoryWPB-10575 Cross Platform Backup: Write common backup / restore library


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

This PR squashes all commits from the epic/multiplatform-backup branch into develop.
The goals is to keep it alongside the current development until we decide to use it. Avoid making it stale.

Important

This does not change any behaviour. The "old" backup is still being used, and nothing of the new backup library is being actually used.

If we want to actually use it, :logic still needs to be changed, and we need to start using :backup for that.

Dependencies

This PR is just all these PRs combined:

Testing

Test Coverage

  • I have added automated test to this contribution

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

vitorhugods and others added 13 commits January 31, 2025 16:09
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.
Co-authored-by: Yamil Medina <yamilmedina@users.noreply.github.com>
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.
…ulation (#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.
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.
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`.
…ion (#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.
@echoes-hq echoes-hq bot added the echoes: product-roadmap/feature Work contributing to adding a new feature as part of the product roadmap. label Feb 6, 2025
Copy link
Contributor

github-actions bot commented Feb 6, 2025

Test Results

3 513 tests  +95   3 405 ✅ +95   6m 14s ⏱️ +13s
  603 suites +19     108 💤 ± 0 
  603 files   +19       0 ❌ ± 0 

Results for commit b71fe49. ± Comparison against base commit 82347b7.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.83%. Comparing base (82347b7) to head (b71fe49).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3279      +/-   ##
===========================================
+ Coverage    50.82%   50.83%   +0.01%     
===========================================
  Files         1606     1607       +1     
  Lines        57243    58052     +809     
  Branches      5109     5203      +94     
===========================================
+ Hits         29094    29513     +419     
- Misses       26134    26523     +389     
- Partials      2015     2016       +1     

see 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 82347b7...b71fe49. Read the comment docs.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Feb 6, 2025

Datadog Report

Branch report: epic/multiplatform-backup
Commit report: 5e54947
Test service: kalium-jvm

✅ 0 Failed, 3405 Passed, 108 Skipped, 1m 2.76s Total Time

Copy link

sonarqubecloud bot commented Feb 6, 2025

Copy link
Contributor

github-actions bot commented Feb 6, 2025

@vitorhugods vitorhugods marked this pull request as ready for review February 6, 2025 12:06
@vitorhugods vitorhugods enabled auto-merge February 6, 2025 12:06
@vitorhugods vitorhugods requested a review from saleniuk February 6, 2025 12:06
@vitorhugods vitorhugods added this pull request to the merge queue Feb 7, 2025
Merged via the queue into develop with commit 20791fd Feb 7, 2025
23 checks passed
@vitorhugods vitorhugods deleted the epic/multiplatform-backup branch February 7, 2025 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: product-roadmap/feature Work contributing to adding a new feature as part of the product roadmap. 👕 size: XXL type: chore 🧹
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants