delete unnecessary real_users_cache, fix overwriting push_target iter, add proper function for getting local active users in room

this `real_users_cache` cache seems weird, and i have no idea what
prompted its creation upstream. perhaps they did this because
sqlite was very slow and their rocksdb setup is very poor, so
a "solution" was to stick member counts in memory.
slow iterators, scanning, etc do not apply to conduwuit where
our rocksdb is extremely tuned, and i seriously doubt something
like this would have any real world net-positive performance impact.

also for some reason, there is suspicious logic where we
overwrite the entire push target collection.

both of these things could be a potential cause for receiving
notifications in rooms we've left.

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-06-04 01:13:43 -04:00
parent c1227340b3
commit c738c119f8
6 changed files with 30 additions and 58 deletions

View file

@ -485,7 +485,7 @@ async fn send_events_dest_push(
.ok_or_else(|| {
(
dest.clone(),
Error::bad_database("[Push] Event in servernamevent_datas not found in db."),
Error::bad_database("[Push] Event in servernameevent_data not found in db."),
)
})?,
);
@ -567,7 +567,7 @@ async fn send_events_dest_normal(
);
(
dest.clone(),
Error::bad_database("[Normal] Event in servernamevent_datas not found in db."),
Error::bad_database("[Normal] Event in servernameevent_data not found in db."),
)
})?,
);