Skip to content

Commit 2386144

Browse files
reivilibresandhose
authored andcommitted
Downgrade presence of guests and unsupported 3pids to warnings
Since migration is supported, but the data won't be used
1 parent d984d2c commit 2386144

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

crates/syn2mas/src/synapse_reader/checks.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,9 @@ pub enum CheckError {
4444
#[error("Password scheme version '1' in the MAS config must have the same secret as the `pepper` value from Synapse, so that Synapse passwords can be imported and will be compatible.")]
4545
PasswordSchemeWrongPepper,
4646

47-
#[error("Synapse database contains {num_guests} guests which aren't supported by MAS. See https://github.com/element-hq/matrix-authentication-service/issues/1445")]
48-
GuestsInDatabase { num_guests: i64 },
49-
5047
#[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")]
5148
GuestsEnabled,
5249

53-
#[error("Synapse database contains {num_non_email_3pids} non-email 3PIDs (probably phone numbers), which are not supported by MAS.")]
54-
NonEmailThreepidsInDatabase { num_non_email_3pids: i64 },
55-
5650
#[error(
5751
"Synapse config has `enable_3pid_changes` explicitly enabled, which must be disabled or removed."
5852
)]
@@ -94,6 +88,12 @@ pub enum CheckWarning {
9488

9589
#[error("Synapse config has a registration CAPTCHA enabled, but no CAPTCHA has been configured in MAS. You may wish to manually configure this.")]
9690
ShouldPortRegistrationCaptcha,
91+
92+
#[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")]
93+
GuestsInDatabase { num_guests: i64 },
94+
95+
#[error("Synapse database contains {num_non_email_3pids} non-email 3PIDs (probably phone numbers), which will be migrated but are not supported by MAS.")]
96+
NonEmailThreepidsInDatabase { num_non_email_3pids: i64 },
9797
}
9898

9999
/// Check that the Synapse configuration is sane for migration.
@@ -229,21 +229,21 @@ pub async fn synapse_database_check(
229229
}
230230

231231
let mut errors = Vec::new();
232-
let warnings = Vec::new();
232+
let mut warnings = Vec::new();
233233

234234
let num_guests: i64 = query_scalar("SELECT COUNT(1) FROM users WHERE is_guest <> 0")
235235
.fetch_one(&mut *synapse_connection)
236236
.await?;
237237
if num_guests > 0 {
238-
errors.push(CheckError::GuestsInDatabase { num_guests });
238+
warnings.push(CheckWarning::GuestsInDatabase { num_guests });
239239
}
240240

241241
let num_non_email_3pids: i64 =
242242
query_scalar("SELECT COUNT(1) FROM user_threepids WHERE medium <> 'email'")
243243
.fetch_one(&mut *synapse_connection)
244244
.await?;
245245
if num_non_email_3pids > 0 {
246-
errors.push(CheckError::NonEmailThreepidsInDatabase {
246+
warnings.push(CheckWarning::NonEmailThreepidsInDatabase {
247247
num_non_email_3pids,
248248
});
249249
}

0 commit comments

Comments
 (0)