Ignore guest devices and empty IPs when migrating from Synapse (#4121)
This commit is contained in:
@@ -414,7 +414,9 @@ async fn migrate_devices(
|
||||
// As we're using a real IP type in the MAS database, it is possible
|
||||
// that we encounter invalid IP addresses in the Synapse database.
|
||||
// In that case, we should ignore them, but still log a warning.
|
||||
let last_active_ip = ip.and_then(|ip| {
|
||||
// One special case: Synapse will record '-' as IP in some cases, we don't want
|
||||
// to log about those
|
||||
let last_active_ip = ip.filter(|ip| ip != "-").and_then(|ip| {
|
||||
ip.parse()
|
||||
.map_err(|e| {
|
||||
tracing::warn!(
|
||||
|
||||
@@ -416,7 +416,7 @@ impl<'conn> SynapseReader<'conn> {
|
||||
SELECT
|
||||
user_id, device_id, display_name, last_seen, ip, user_agent
|
||||
FROM devices
|
||||
WHERE NOT hidden
|
||||
WHERE NOT hidden AND device_id != 'guest_device'
|
||||
",
|
||||
)
|
||||
.fetch(&mut *self.txn)
|
||||
|
||||
Reference in New Issue
Block a user