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

Move libolm migration code to a separate crate #2959

Closed
wants to merge 9 commits into from

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Dec 20, 2023

This is currently something of an experimental PR, but I want to run the CI checks on it.

Part of matrix-org/matrix-rust-sdk-crypto-wasm#78.

@richvdh richvdh requested a review from a team as a code owner December 20, 2023 13:47
@richvdh richvdh requested review from bnjbvr and removed request for a team December 20, 2023 13:47
Copy link

codecov bot commented Dec 20, 2023

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (320b868) 83.50% compared to head (289e304) 83.52%.
Report is 28 commits behind head on main.

Files Patch % Lines
crates/matrix-sdk-libolm-migration/src/lib.rs 81.37% 19 Missing ⚠️
crates/matrix-sdk-libolm-migration/src/types.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    matrix-org/matrix-rust-sdk#2959      +/-   ##
==========================================
+ Coverage   83.50%   83.52%   +0.02%     
==========================================
  Files         221      223       +2     
  Lines       23007    23121     +114     
==========================================
+ Hits        19211    19311     +100     
- Misses       3796     3810      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Hywan
Copy link
Member

Hywan commented Dec 21, 2023

If that's experimental, I'm removing @bnjbvr from the reviewer list. Please, ping someone once it's ready for a review.

@Hywan Hywan removed the request for review from bnjbvr December 21, 2023 13:27
@richvdh richvdh force-pushed the rav/migrate_migrations_code branch from 8ff55db to e433a2d Compare December 21, 2023 15:54
@richvdh richvdh force-pushed the rav/migrate_migrations_code branch from 35e7545 to 289e304 Compare December 21, 2023 17:57
use serde::{Deserialize, Serialize};

/// Struct collecting data that is important to migrate sessions to the rust-sdk
#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a simple move of these 5 types, with the only difference being that the uniffi:* derivation needs to become conditional on the feature flag.

@@ -121,7 +121,7 @@ where
let tracked_users: Vec<_> = data
.tracked_users
.into_iter()
.filter_map(|s| UserId::parse(&s).ok().map(|u| (u, true)))
.filter_map(|s| UserId::parse(s).ok().map(|u| (u, true)))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we run the clippy checks on the new crate but not the old one?

@richvdh
Copy link
Member Author

richvdh commented Dec 29, 2023

I've decided not to do this. It turns out that we can't actually share much code with the wasm bindings anyway, because the wasm bindings want their own wrapper classes.

Plus there are various weirdnesses in the existing code which make them really horrible to use, but fixing them would break apps using the FFI bindings (notably: timestamps which are strings holding seconds-since-the-epoch: #2974).

@richvdh richvdh closed this Dec 29, 2023
@poljar poljar deleted the rav/migrate_migrations_code branch November 5, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants