fix(sync): honor paused object policies

This commit is contained in:
2026-05-16 03:53:42 -04:00
parent 8c2dffddc7
commit 47eaea28a2
3 changed files with 47 additions and 1 deletions
@@ -1,6 +1,6 @@
use std::{collections::BTreeSet, time::SystemTime};
use ely_domain::{BookmarkEntry, BookmarkId, SpaceId, UrlText};
use ely_domain::{BookmarkEntry, BookmarkId, SpaceId, SyncObjectKind, SyncObjectPolicy, UrlText};
use serde::{Deserialize, Serialize};
use crate::CoreError;
@@ -246,6 +246,9 @@ impl BrowserCore {
/// used by the sync engine which mirrors the full state to the
/// Cloudflare worker, not just the visible profile.
pub fn visible_bookmarks_for_sync(&self) -> Vec<&BookmarkEntry> {
if self.sync_object_policy(SyncObjectKind::Bookmarks) == SyncObjectPolicy::Paused {
return Vec::new();
}
self.bookmarks.iter().collect()
}
@@ -178,6 +178,9 @@ impl BrowserCore {
}
pub(crate) fn visible_tabs_for_sync(&self) -> Vec<&BrowserTab> {
if self.sync_object_policy(SyncObjectKind::Tabs) == SyncObjectPolicy::Paused {
return Vec::new();
}
self.tabs
.iter()
.filter(|tab| {