From bfcd0f82094e6090bc9e249b352a2b6002c2b965 Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Thu, 30 Jan 2025 19:54:31 +0000 Subject: [PATCH] Downgrade presence of guests and unsupported 3pids to warnings Since migration is supported, but the data won't be used --- crates/syn2mas/src/synapse_reader/checks.rs | 26 ++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/syn2mas/src/synapse_reader/checks.rs b/crates/syn2mas/src/synapse_reader/checks.rs index 84148d7a9..83f31bbcf 100644 --- a/crates/syn2mas/src/synapse_reader/checks.rs +++ b/crates/syn2mas/src/synapse_reader/checks.rs @@ -48,21 +48,11 @@ pub enum CheckError { )] PasswordSchemeWrongPepper, - #[error( - "Synapse database contains {num_guests} guests which aren't supported by MAS. See https://github.com/element-hq/matrix-authentication-service/issues/1445" - )] - GuestsInDatabase { num_guests: i64 }, - #[error( "Guest support is enabled in the Synapse configuration. Guests aren't supported by MAS, but if you don't have any then you could disable the option. See https://github.com/element-hq/matrix-authentication-service/issues/1445" )] GuestsEnabled, - #[error( - "Synapse database contains {num_non_email_3pids} non-email 3PIDs (probably phone numbers), which are not supported by MAS." - )] - NonEmailThreepidsInDatabase { num_non_email_3pids: i64 }, - #[error( "Synapse config has `enable_3pid_changes` explicitly enabled, which must be disabled or removed." )] @@ -125,6 +115,16 @@ pub enum CheckWarning { "Synapse config has a registration CAPTCHA enabled, but no CAPTCHA has been configured in MAS. You may wish to manually configure this." )] ShouldPortRegistrationCaptcha, + + #[error( + "Synapse database contains {num_guests} guests which will be migrated are not supported by MAS. See https://github.com/element-hq/matrix-authentication-service/issues/1445" + )] + GuestsInDatabase { num_guests: i64 }, + + #[error( + "Synapse database contains {num_non_email_3pids} non-email 3PIDs (probably phone numbers), which will be migrated but are not supported by MAS." + )] + NonEmailThreepidsInDatabase { num_non_email_3pids: i64 }, } /// Check that the Synapse configuration is sane for migration. @@ -260,13 +260,13 @@ pub async fn synapse_database_check( } let mut errors = Vec::new(); - let warnings = Vec::new(); + let mut warnings = Vec::new(); let num_guests: i64 = query_scalar("SELECT COUNT(1) FROM users WHERE is_guest <> 0") .fetch_one(&mut *synapse_connection) .await?; if num_guests > 0 { - errors.push(CheckError::GuestsInDatabase { num_guests }); + warnings.push(CheckWarning::GuestsInDatabase { num_guests }); } let num_non_email_3pids: i64 = @@ -274,7 +274,7 @@ pub async fn synapse_database_check( .fetch_one(&mut *synapse_connection) .await?; if num_non_email_3pids > 0 { - errors.push(CheckError::NonEmailThreepidsInDatabase { + warnings.push(CheckWarning::NonEmailThreepidsInDatabase { num_non_email_3pids, }); }