mirror of
https://forgejo.ellis.link/continuwuation/continuwuity/
synced 2026-08-14 06:19:43 +00:00
fix(sync): Remove sync wake before membership commit point
This commit is contained in:
committed by
Ellis Git
parent
2998dc9b40
commit
7472faa096
@@ -0,0 +1 @@
|
||||
Fixed sync loops being woken before membership changes are fully committed.
|
||||
@@ -16,9 +16,7 @@
|
||||
serde::Raw,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
Dep, account_data, appservice::RegistrationInfo, config, globals, rooms, sync, users,
|
||||
};
|
||||
use crate::{Dep, account_data, appservice::RegistrationInfo, config, globals, rooms, users};
|
||||
|
||||
pub struct Service {
|
||||
appservice_in_room_cache: AppServiceInRoomCache,
|
||||
@@ -33,7 +31,6 @@ struct Services {
|
||||
metadata: Dep<rooms::metadata::Service>,
|
||||
state: Dep<rooms::state::Service>,
|
||||
state_accessor: Dep<rooms::state_accessor::Service>,
|
||||
sync: Dep<sync::Service>,
|
||||
users: Dep<users::Service>,
|
||||
}
|
||||
|
||||
@@ -70,7 +67,6 @@ fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
|
||||
state: args.depend::<rooms::state::Service>("rooms::state"),
|
||||
state_accessor: args
|
||||
.depend::<rooms::state_accessor::Service>("rooms::state_accessor"),
|
||||
sync: args.depend::<sync::Service>("sync"),
|
||||
users: args.depend::<users::Service>("users"),
|
||||
},
|
||||
db: Data {
|
||||
|
||||
@@ -133,13 +133,6 @@ pub async fn update_membership(
|
||||
self.update_joined_count(room_id).await;
|
||||
}
|
||||
|
||||
// Kick the target user's sync loop if they're local and this isn't a join to
|
||||
// make sure that membership changes like invites or invite rejections get
|
||||
// synced
|
||||
if is_local && !matches!(membership.membership, MembershipState::Join) {
|
||||
self.services.sync.wake(user_id).await;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user