partially revert keeping track of remote user profiles

this seems to require some more work to properly ignore
dead server errors without breaking the entire room join

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-01-14 01:58:06 -05:00 committed by June
parent 149d22eef7
commit 2b031e40a2
3 changed files with 13 additions and 3 deletions

View file

@ -41,7 +41,6 @@
- Send a User-Agent on all of our requests (`conduwuit/0.7.0-alpha+conduwuit-0.1.1`) which strangely was not done upstream since forever. Some providers consider no User-Agent suspicious and block said requests.
- Safer and cleaner shutdowns on both database side as we run cleanup on shutdown and exits database loop better (no potential hanging issues in database loop), overall cleaner shutdown logic
- Basic binary commands like `conduwuit --version` work (interested in expanding it more)
- Keep track of remote user profiles for profile directory (user profile searching) and local requests for remote profiles (via upstream MR with changes)
- Allow HEAD HTTP requests in CORS for clients (despite not being explicity mentioned in Matrix spec, HTTP spec says all HEAD requests need to behave the same as GET requests, Synapse supports HEAD requests)
- Bump MSRV to 1.74.1
- Purge unmaintained/irrelevant/broken database backends (heed, sled, persy)

View file

@ -127,6 +127,8 @@ pub async fn get_displayname_route(
)
.await?;
/*
TODO: ignore errors properly?
// Create and update our local copy of the user
// these are `let _` because it's fine if we can't find these for the user.
// also these requests are sent on room join so dead servers will make room joins annoying again
@ -143,6 +145,7 @@ pub async fn get_displayname_route(
.users
.set_blurhash(&body.user_id, response.blurhash)
.await;
*/
return Ok(get_display_name::v3::Response {
displayname: response.displayname,
@ -271,6 +274,8 @@ pub async fn get_avatar_url_route(
)
.await?;
/*
TODO: ignore errors properly?
// Create and update our local copy of the user
// these are `let _` because it's fine if we can't find these for the user.
// also these requests are sent on room join so dead servers will make room joins annoying again
@ -287,6 +292,7 @@ pub async fn get_avatar_url_route(
.users
.set_blurhash(&body.user_id, response.blurhash.clone())
.await;
*/
return Ok(get_avatar_url::v3::Response {
avatar_url: response.avatar_url,
@ -323,6 +329,8 @@ pub async fn get_profile_route(
)
.await?;
/*
TODO: ignore errors properly?
// Create and update our local copy of the user
// these are `let _` because it's fine if we can't find these for the user.
// also these requests are sent on room join so dead servers will make room joins annoying again
@ -339,6 +347,7 @@ pub async fn get_profile_route(
.users
.set_blurhash(&body.user_id, response.blurhash.clone())
.await;
*/
return Ok(get_profile::v3::Response {
displayname: response.displayname,

View file

@ -4,7 +4,6 @@ use std::{collections::HashSet, sync::Arc};
pub use data::Data;
use ruma::{
api::federation::{self, query::get_profile_information::v1::ProfileField},
events::{
direct::DirectEvent,
ignored_user_list::IgnoredUserListEvent,
@ -42,7 +41,9 @@ impl Service {
// Keep track what remote users exist by adding them as "deactivated" users
if user_id.server_name() != services().globals.server_name() {
services().users.create(user_id, None)?;
/*
// Try to update our local copy of the user if ours does not match
// TODO: ignore errors properly?
if ((services().users.displayname(user_id)? != membership_event.displayname)
|| (services().users.avatar_url(user_id)? != membership_event.avatar_url)
|| (services().users.blurhash(user_id)? != membership_event.blurhash))
@ -71,6 +72,7 @@ impl Service {
.set_blurhash(user_id, response.blurhash)
.await;
};
*/
}
match &membership {