Skip to content

Commit 31fae19

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 140ab7e commit 31fae19

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

crates/syn2mas/src/synapse_reader/checks.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,11 @@ pub enum CheckError {
4848
)]
4949
PasswordSchemeWrongPepper,
5050

51-
#[error(
52-
"Synapse database contains {num_guests} guests which aren't supported by MAS. See https://github.com/element-hq/matrix-authentication-service/issues/1445"
53-
)]
54-
GuestsInDatabase { num_guests: i64 },
55-
5651
#[error(
5752
"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"
5853
)]
5954
GuestsEnabled,
6055

61-
#[error(
62-
"Synapse database contains {num_non_email_3pids} non-email 3PIDs (probably phone numbers), which are not supported by MAS."
63-
)]
64-
NonEmailThreepidsInDatabase { num_non_email_3pids: i64 },
65-
6656
#[error(
6757
"Synapse config has `enable_3pid_changes` explicitly enabled, which must be disabled or removed."
6858
)]
@@ -125,6 +115,16 @@ pub enum CheckWarning {
125115
"Synapse config has a registration CAPTCHA enabled, but no CAPTCHA has been configured in MAS. You may wish to manually configure this."
126116
)]
127117
ShouldPortRegistrationCaptcha,
118+
119+
#[error(
120+
"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"
121+
)]
122+
GuestsInDatabase { num_guests: i64 },
123+
124+
#[error(
125+
"Synapse database contains {num_non_email_3pids} non-email 3PIDs (probably phone numbers), which will be migrated but are not supported by MAS."
126+
)]
127+
NonEmailThreepidsInDatabase { num_non_email_3pids: i64 },
128128
}
129129

130130
/// Check that the Synapse configuration is sane for migration.
@@ -260,21 +260,21 @@ pub async fn synapse_database_check(
260260
}
261261

262262
let mut errors = Vec::new();
263-
let warnings = Vec::new();
263+
let mut warnings = Vec::new();
264264

265265
let num_guests: i64 = query_scalar("SELECT COUNT(1) FROM users WHERE is_guest <> 0")
266266
.fetch_one(&mut *synapse_connection)
267267
.await?;
268268
if num_guests > 0 {
269-
errors.push(CheckError::GuestsInDatabase { num_guests });
269+
warnings.push(CheckWarning::GuestsInDatabase { num_guests });
270270
}
271271

272272
let num_non_email_3pids: i64 =
273273
query_scalar("SELECT COUNT(1) FROM user_threepids WHERE medium <> 'email'")
274274
.fetch_one(&mut *synapse_connection)
275275
.await?;
276276
if num_non_email_3pids > 0 {
277-
errors.push(CheckError::NonEmailThreepidsInDatabase {
277+
warnings.push(CheckWarning::NonEmailThreepidsInDatabase {
278278
num_non_email_3pids,
279279
});
280280
}

0 commit comments

Comments
 (0)