Fix and test broken room bridge check #104

Merged
cadence merged 2 commits from l1s5/out-of-your-element:fix-room-bridged-sql-query into main 2026-11-04 22:26:37 +00:00
2 changed files with 10 additions and 1 deletions

View file

@ -0,0 +1,9 @@
BEGIN TRANSACTION;
DELETE FROM member_cache
WHERE room_id NOT IN (SELECT room_id FROM channel_room)
AND room_id NOT IN (SELECT space_id FROM guild_space)
AND room_id NOT IN (SELECT room_id FROM historical_channel_room)
AND room_id NOT IN (SELECT room_id FROM invite);
COMMIT;

View file

@ -422,7 +422,7 @@ async event => {
if (utils.eventSenderIsFromDiscord(event.state_key)) return if (utils.eventSenderIsFromDiscord(event.state_key)) return
const exists = select("channel_room", "room_id", {room_id: event.room_id}) ?? select("guild_space", "space_id", {space_id: event.room_id}) const exists = select("channel_room", "room_id", {room_id: event.room_id}).pluck().get() ?? select("guild_space", "space_id", {space_id: event.room_id}).pluck().get()
if (!exists) return // don't cache members in unbridged rooms if (!exists) return // don't cache members in unbridged rooms
// Member is here // Member is here