Compare commits

...

3 Commits

Author SHA1 Message Date
Devon Hudson
49484cc371 Merge branch 'develop' into devon/remote-invite-reject-sss-fix 2025-03-24 20:27:24 +00:00
Devon Hudson
717fcf2b19 Add hacks to fix remote invite rejection 2025-03-24 14:26:02 -06:00
Devon Hudson
41e2f4961b HACK: Fix to send remote invite rejection down SSS 2025-03-24 14:22:38 -06:00
2 changed files with 24 additions and 4 deletions

View File

@@ -509,9 +509,13 @@ class EventsPersistenceStorageController:
)
)
await self.persist_events_store.update_current_state(
room_id, delta, sliding_sync_table_changes
)
logger.error("Devon: persist update_current_state: %s %s %s", state, delta, sliding_sync_table_changes)
# FIXME: Devon removed this to stop deleting the leave event from the sliding sync
# tables
# await self.persist_events_store.update_current_state(
# room_id, delta, sliding_sync_table_changes
# )
async def _calculate_current_state(self, room_id: str) -> StateMap[str]:
"""Calculate the current state of a room, based on the forward extremities
@@ -638,6 +642,21 @@ class EventsPersistenceStorageController:
room_id, [e for e, _ in chunk]
)
# FIXME: Temporary hack to add remote invite to state delta
if not new_forward_extremities:
state_map: MutableStateMap[str] = {}
for (a, _) in chunk:
if a.type == EventTypes.Member and a.membership == Membership.LEAVE:
state_key = a.get_state_key()
if state_key:
logger.error("Devon: injecting hack into state map")
state_map[(a.type, state_key)] = a.event_id
if state_map:
state_delta_for_room = DeltaState([], state_map, False)
logger.error("Devon: state delta for room: %s", state_delta_for_room)
# Stop the state groups from being deleted while we're persisting
# them.
async with self._state_deletion_store.persisting_state_group_references(

View File

@@ -562,7 +562,8 @@ class PersistEventsStore:
#
# Ideally, we could additionally assert that we're only here for
# valid non-join membership transitions.
assert delta_state.no_longer_in_room
#assert delta_state.no_longer_in_room
pass
# Handle gathering info for the `sliding_sync_joined_rooms` table
#