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

Automatic sync - sync worker #1207

Merged
merged 51 commits into from
Nov 7, 2024
Merged

Automatic sync - sync worker #1207

merged 51 commits into from
Nov 7, 2024

Conversation

codabrink
Copy link
Contributor

No description provided.

@codabrink codabrink marked this pull request as ready for review November 6, 2024 21:13
@codabrink codabrink requested a review from a team as a code owner November 6, 2024 21:13
@codabrink codabrink changed the title Coda/sync auto Automatic sync - sync worker Nov 6, 2024
@@ -228,6 +228,10 @@ pub struct MlsGroup<C> {
mutex: Arc<Mutex<()>>,
}

// C is wrapped in an Arc, and so is the Mutex, so this is fine.
unsafe impl<C> Send for MlsGroup<C> {}
unsafe impl<C> Sync for MlsGroup<C> {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@insipx This is so we can use this feature on wasm since the Client is neither Send nor Sync there. Everything in MlsGroup that isn't Send/Sync already is wrapped in an Arc, so this should be fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

If this is only for wasm, we should have it under #[cfg(target_arch = "wasm32")]

xmtp_mls/src/groups/device_sync.rs Outdated Show resolved Hide resolved
xmtp_mls/src/groups/device_sync.rs Outdated Show resolved Hide resolved
@@ -228,6 +228,10 @@ pub struct MlsGroup<C> {
mutex: Arc<Mutex<()>>,
}

// C is wrapped in an Arc, and so is the Mutex, so this is fine.
unsafe impl<C> Send for MlsGroup<C> {}
unsafe impl<C> Sync for MlsGroup<C> {}
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is only for wasm, we should have it under #[cfg(target_arch = "wasm32")]

xmtp_mls/src/groups/device_sync.rs Outdated Show resolved Hide resolved
xmtp_mls/src/groups/device_sync.rs Outdated Show resolved Hide resolved
xmtp_mls/src/groups/device_sync.rs Outdated Show resolved Hide resolved
@nplasterer
Copy link
Contributor

I tested this in the android SDK and works like expected 🎉

@codabrink codabrink force-pushed the coda/sync-auto branch 2 times, most recently from cd5688e to 0a2fcc8 Compare November 7, 2024 15:41
xmtp_mls/src/groups/mod.rs Outdated Show resolved Hide resolved
@codabrink codabrink merged commit 0d3bf35 into main Nov 7, 2024
17 checks passed
@codabrink codabrink deleted the coda/sync-auto branch November 7, 2024 17:19
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.

4 participants