fix: Adjust sync watcher logic to be more explicit

This commit is contained in:
Ginger authored and Ellis Git committed 2026-07-05 00:42:44 +00:00
1 parent 3adeee04d7
commit 3467dffd94
22 files changed
+189 -249

No files matched your search

+4
View File
@@ -191,6 +191,8 @@ impl super::Service {
"content": content,
})),
);
self.services.sync.wake(target_user_id).await;
}
/// Gets all to-device events between the two counts.
@@ -242,6 +244,8 @@ impl super::Service {
self.db.todeviceid_events.del(key);
})
.await;
self.services.sync.wake(user_id).await;
}
/// Updates device metadata and increments the device list version.
+9 -2
View File
@@ -56,6 +56,8 @@ impl super::Service {
let count = self.services.globals.next_count().unwrap();
self.db.userid_lastonetimekeyupdate.raw_put(user_id, count);
self.services.sync.wake(user_id).await;
Ok(())
}
@@ -152,6 +154,7 @@ impl super::Service {
});
if let Some(result) = one_time_key {
self.services.sync.wake(user_id).await;
return Ok(result);
}
@@ -183,6 +186,8 @@ impl super::Service {
)
.await?;
}
self.services.sync.wake(user_id).await;
return Ok((fallback_key_id, fallback_key_value));
}
@@ -450,9 +455,11 @@ impl super::Service {
None
}
})
.ready_for_each(|room_id| {
let key = (room_id, count);
.for_each(async |room_id| {
let key = (&room_id, count);
self.db.keychangeid_userid.put_raw(key, user_id);
self.services.sync.wake_all_joined(&room_id).await;
})
.await;
+3 -1
View File
@@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize};
use crate::{
Dep, account_data, admin, appservice, config, firstrun, globals, oauth, presence,
rooms::{self, alias, membership},
threepid,
sync, threepid,
};
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -67,6 +67,7 @@ struct Services {
state: Dep<rooms::state::Service>,
state_accessor: Dep<rooms::state_accessor::Service>,
state_cache: Dep<rooms::state_cache::Service>,
sync: Dep<sync::Service>,
threepid: Dep<threepid::Service>,
timeline: Dep<rooms::timeline::Service>,
}
@@ -119,6 +120,7 @@ impl crate::Service for Service {
state_accessor: args
.depend::<rooms::state_accessor::Service>("rooms::state_accessor"),
state_cache: args.depend::<rooms::state_cache::Service>("rooms::state_cache"),
sync: args.depend::<sync::Service>("sync"),
threepid: args.depend::<threepid::Service>("threepid"),
timeline: args.depend::<rooms::timeline::Service>("rooms::timeline"),
},