feat: teams plan

This commit is contained in:
zhom
2026-03-02 15:49:26 +04:00
parent 9822ad4e3f
commit acd572ed23
30 changed files with 1223 additions and 200 deletions
+16 -1
View File
@@ -208,8 +208,21 @@ impl SyncSubscription {
data_line.and_then(|data| serde_json::from_str(data).ok())
}
fn strip_team_prefix(key: &str) -> &str {
if key.starts_with("teams/") {
if let Some(rest) = key.find('/').and_then(|first_slash| {
key[first_slash + 1..]
.find('/')
.map(|second_slash| first_slash + 1 + second_slash + 1)
}) {
return &key[rest..];
}
}
key
}
fn handle_event(event: &SubscribeEvent, work_tx: &mpsc::UnboundedSender<SyncWorkItem>) {
let Some(key) = &event.key else {
let Some(raw_key) = &event.key else {
return;
};
@@ -217,6 +230,8 @@ impl SyncSubscription {
return;
}
let key = Self::strip_team_prefix(raw_key);
let work_item = if key.starts_with("profiles/") {
key
.strip_prefix("profiles/")