refactor(threepid): Use SyncMutex and decouple guard from ValidSession

Change threepid sessions and send_attempts to SyncMutex and avoid

holding the sessions mutex across callers of get_valid_session.
This commit is contained in:
Jade Ellis committed 2026-10-28 21:47:09 +00:00
1 parent 98ae1fcaa1
commit 18f5f4fbfa
7 files changed
+90 -98

No files matched your search

-1
View File
@@ -167,7 +167,6 @@ async fn get_change_email_validate(
let Ok(session) = services
.threepid
.get_valid_session(&session_id, &client_secret)
.await
else {
return response!(ChangeEmailValidate::new(
context,
-1
View File
@@ -189,7 +189,6 @@ async fn route_reset_password_validate(
let body = match services
.threepid
.get_valid_session(&query.threepid.session_id, &query.threepid.client_secret)
.await
{
| Ok(session) => {
let Some(localpart) = services
-1
View File
@@ -289,7 +289,6 @@ async fn get_register_email_validate(
let Ok(session) = services
.threepid
.get_valid_session(&session_id, &client_secret)
.await
else {
return response!(RegisterEmailValidate::new(context, session_id, client_secret, true));
};
-1
View File
@@ -33,7 +33,6 @@ async fn threepid_validation(
services
.threepid
.try_validate_session(&query.session, &query.token)
.await
.map_err(|message| WebError::BadRequest(message.into_owned()))?;
Ok(ThreepidValidation::new(context))